Skip to content

Commit

Permalink
Add option to run a specific test in watch mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
dompuiu committed Oct 9, 2024
1 parent 9bda0ea commit 567fbeb
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions scripts/watchFunctionalTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ program.addOption(
.default("chrome"),
);

program.addOption(
new Option(
"--specsPath <specsPath...>",
"configures the test runner to run tests from the specified files",
),
);

program.parse();

const argv = program.opts();
Expand Down Expand Up @@ -68,8 +75,14 @@ const effectByEventCode = {
} else {
firstBuildComplete = true;
const testcafe = await createTestCafe();
const liveRunner = testcafe.createLiveModeRunner();
await liveRunner.browsers(argv.browsers).run();
let liveRunner = testcafe.createLiveModeRunner();
liveRunner = liveRunner.browsers(argv.browsers);

if (argv.specsPath) {
liveRunner = await liveRunner.src(argv.specsPath);
}

await liveRunner.run();
await testcafe.close();
}
},
Expand Down

0 comments on commit 567fbeb

Please sign in to comment.