Skip to content

Commit c8317d7

Browse files
committed
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Add a brand new watcher
1 parent 5bada71 commit c8317d7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

test/watch-mode/helpers/watch.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,15 @@ export const withFixture = fixture => async (t, task) => {
8080
const assertIdle = async next => {
8181
assertingIdle = true;
8282

83-
t.timeout(10_000);
83+
// TODO: When testing using AVA 6, enable for better managed timeouts.
84+
// t.timeout(10_000);
8485

8586
const promise = Promise.all([delay(5000, null, {ref: false}), next?.()]).finally(() => {
8687
if (idlePromise === promise) {
8788
idlePromise = new Promise(() => {});
8889
assertingIdle = false;
90+
// TODO: When testing using AVA 6, enable for better managed timeouts.
91+
// t.timeout(0);
8992
if (failedIdleAssertion) {
9093
failedIdleAssertion = false;
9194
t.fail('Watcher performed a test run while it should have been idle');
@@ -142,7 +145,6 @@ export const withFixture = fixture => async (t, task) => {
142145
t.is(activeWatchCount, 0, 'Handlers for all watch() calls should have invoked `this.done()` to end their tests');
143146
completedTask = true;
144147
}).catch(error => {
145-
console.error({completedTask, error});
146148
if (!completedTask) {
147149
throw error;
148150
}

test/watch-mode/typescript.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {test, withFixture} from './helpers/watch.js';
66
test('waits for external compiler before re-running typescript test files', withFixture('typescript-precompiled'), async (t, fixture) => {
77
await fixture.watch({
88
async 1({stats}) {
9-
t.log(stats);
9+
t.true(stats.passed.length > 0);
1010
await this.assertIdle(async () => {
1111
await this.touch('src/test.ts');
1212
});
@@ -74,11 +74,9 @@ test('handles inline compilation', withFixture('typescript-inline'), async (t, f
7474
test('ignores changes to compiled files with inline compilation', withFixture('typescript-inline'), async (t, fixture) => {
7575
await fs.symlink(new URL('../../node_modules', import.meta.url), path.join(fixture.dir, 'node_modules'), 'junction');
7676
await fixture.watch({
77-
async 1(result) {
78-
t.log(result.stats);
79-
t.log(result.stats.getError(result.stats.internalErrors[0]));
77+
async 1({stats}) {
78+
t.true(stats.passed.length > 0);
8079
await this.assertIdle(async () => {
81-
t.log(await fs.readdir(path.join(fixture.dir)));
8280
await this.touch('build/test.js');
8381
});
8482
this.done();

0 commit comments

Comments
 (0)