Skip to content

Commit 391aebd

Browse files
committed
Fix Error: [vitest-worker]: Timeout calling "onTaskUpdate"
1 parent e908710 commit 391aebd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/cli.test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ describe('CLI', () => {
8787
});
8888

8989
describe('Lossless (--lossless)', () => {
90+
afterEach(async () => {
91+
// Fix for `Error: [vitest-worker]: Timeout calling "onTaskUpdate"`
92+
// https://github.com/vitest-dev/vitest/issues/4497#issuecomment-1887757764
93+
await new Promise(resolve => setImmediate(resolve)); // eslint-disable-line no-promise-executor-return
94+
});
95+
9096
test('JPEG/JPG should be optimized', () => {
9197
const file = 'jpeg-not-optimized.jpeg';
9298
const stdout = runCliWithParameters(`--lossless ${workDirectory}${file}`);

0 commit comments

Comments
 (0)