Skip to content

Commit

Permalink
fix(runner): should throw if no test found in non-watch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
PaperStrike committed Oct 26, 2023
1 parent b8dec42 commit 0641b49
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/server/Runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,12 @@ export default class Runner implements Disposable {
const importFiles = await testFinder.getFiles();
if (setupFile) importFiles.unshift(setupFile.replace(/\\/g, '\\\\'));
if (importFiles.length === 0) {
// eslint-disable-next-line no-console
console.warn('No test file found');
if (watch) {
// eslint-disable-next-line no-console
console.error('No test file found');
} else {
throw new Error('No test file found');
}
}
const importStatements = importFiles.map((file) => `import '${file}'`).join('\n');
return {
Expand Down

0 comments on commit 0641b49

Please sign in to comment.