Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! fixup! fixup! Add a brand new watcher
Browse files Browse the repository at this point in the history
  • Loading branch information
novemberborn committed Jul 2, 2023
1 parent a4b4ab4 commit 3232df8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/watch-mode/basic-functionality.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test('ctrl+c interrupts', withFixture('basic'), async (t, fixture) => {
const result = await t.try(tt => {
tt.regex(stdout, /Exiting due to SIGINT/);
});
if (platform === 'win32') {
if (platform === 'win32' && !result.passed) {
result.discard();
t.pass('Most likely on Windows we did not capture stdout when the process was killed');
} else {
Expand Down
5 changes: 4 additions & 1 deletion test/watch-mode/helpers/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ export const withFixture = fixture => async (t, task) => {
results.return();

// Handle outstanding promises in case they reject.
if (assertingIdle) await idlePromise;
if (assertingIdle) {
await idlePromise;
}

await pendingState;
}
},
Expand Down
2 changes: 2 additions & 0 deletions test/watch-mode/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {test, withFixture} from './helpers/watch.js';
test('waits for external compiler before re-running typescript test files', withFixture('typescript-precompiled'), async (t, fixture) => {
await fixture.watch({
async 1({stats}) {
t.log(stats);
await this.assertIdle(async () => {
await this.touch('src/test.ts');
});
Expand Down Expand Up @@ -58,6 +59,7 @@ test('handles inline compilation', withFixture('typescript-inline'), async (t, f
await fs.symlink(new URL('../../node_modules', import.meta.url), path.join(fixture.dir, 'node_modules'));
await fixture.watch({
async 1({stats}) {
t.true(stats.passed.length > 0);
await this.touch('src/test.ts');
return stats.passed;
},
Expand Down

0 comments on commit 3232df8

Please sign in to comment.