Skip to content

Commit 08f2a8e

Browse files
committed
chore: fix failing unit tests
1 parent 7d69602 commit 08f2a8e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/common/services/commands-service.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ export class CommandsService implements ICommandsService {
2929
private $extensibilityService: IExtensibilityService,
3030
private $optionsTracker: IOptionsTracker,
3131
private $projectDataService: IProjectDataService) {
32-
const projectData = this.$projectDataService.getProjectData();
32+
let projectData = null;
33+
try {
34+
projectData = this.$projectDataService.getProjectData();
35+
} catch (err) {
36+
this.$logger.trace(`Error while trying to get project data. More info: ${err}`);
37+
}
38+
3339
this.$options.setupOptions(projectData);
3440
}
3541

lib/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class Options {
3535
return;
3636
}
3737

38-
if (projectData.isHmrEnabledByDefault) {
38+
if (projectData && projectData.isHmrEnabledByDefault) {
3939
this.argv.bundle = this.argv.bundle !== undefined ? this.argv.bundle : "webpack";
4040
this.argv.hmr = !this.argv.release;
4141
}

0 commit comments

Comments
 (0)