Skip to content

Commit

Permalink
fix: Minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
EntraptaJ committed May 31, 2020
1 parent 9840aca commit 2c29e34
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/Modules/Worker/WorkerController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,20 @@ export class WorkerController extends BaseEventEmitter<
const contentName = dirContent.name;
const contentPath = resolvePath(directoryPath, contentName);

if (contentName === 'node_modules') return [];
if (contentName === 'node_modules') {
return [];
}

if (dirContent.isDirectory()) {
return processDirectory(contentPath);
}

if (controllerOptions.testFileRegex.test(dirContent.name)) {
return new TestFile({
path: contentPath,
});
return [
new TestFile({
path: contentPath,
}),
];
}

return [];
Expand Down Expand Up @@ -205,7 +209,9 @@ export class WorkerController extends BaseEventEmitter<
break;
case WorkerMessageType.PUSH_TEST_SUITE:
testFile = this.findTestFile(message.filePath);
if (!testFile) throw new Error('Worker sent invalid testFile');
if (!testFile) {
throw new Error('Worker sent invalid testFile');
}

testFile.tests.push(
new Test({
Expand Down

0 comments on commit 2c29e34

Please sign in to comment.