Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
feat(node): trigger all tests
Browse files Browse the repository at this point in the history
If a file is saved that neither is a source file nor a test file ensure triggering all tests
This is nice for example changing html files running the `puppeteer` command
  • Loading branch information
stoffeastrom committed Aug 16, 2018
1 parent 0da49bf commit f71347f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions commands/node/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,14 +374,14 @@ class Runner extends EventEmitter {
}
const isTestFile = this.testFiles.indexOf(f) !== -1;
const isSrcFile = this.srcFiles.indexOf(f) !== -1;
if (!isTestFile && !isSrcFile) {
return;
}
this.all = false;
if (isTestFile) {
this.setOnlyFilesFromTestFile(f);
} else {
} else if (isSrcFile) {
this.setOnlyFilesFromSrcFile(f);
} else {
this.onlySrcFiles = this.srcFiles;
this.onlyTestFiles = this.testFiles;
}
this.setupAndRunTests(this.onlyTestFiles, this.onlySrcFiles);
}
Expand Down
4 changes: 2 additions & 2 deletions examples/puppeteer/aw.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = {
glob: ['examples/puppeteer/test/*.spec.js'],
watchGlob: ['examples/puppeteer/test/*.{js,html}']
}
watchGlob: ['examples/puppeteer/test/*.{js,html}'],
};

0 comments on commit f71347f

Please sign in to comment.