jest-playback icon indicating copy to clipboard operation
jest-playback copied to clipboard

Test suite passes, but process throws `AssertionError: playback not found`

Open skilbjo opened this issue 1 year ago • 0 comments

file.test.ts

import * as jestPlayback from 'jest-playback'; 

await jestPlayback.setup({ mode: jestPlayback.Mode.Play });

...

execution:

$ npm test -- file.test.ts -u

> node --no-warnings --experimental-vm-modules node_modules/.bin/jest file.test.ts -u

{"level":"debug","time":"2024-01-23T07:16:46.303Z","msg":"making request"}
{"level":"debug","time":"2024-01-23T07:16:46.366Z","msg":"made request"}
 PASS  file.test.ts (6.144 s)
  test
    ✓ test happy path (77 ms)

Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   1 passed, 1 total
Time:        6.171 s, estimated 8 s
Ran all test suites matching /file.test.ts/i.
AssertionError [ERR_ASSERTION]: playback not found
    at PlaybackManager.onRequest (/Users/skilbjo/dev/providers/node_modules/jest-playback/lib/manager.js:30:17)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /Users/skilbjo/dev/providers/node_modules/jest-playback/lib/setup.js:21:26
    at async queue.push.done (/Users/skilbjo/dev/providers/node_modules/@mswjs/interceptors/lib/node/chunk-Y5QA6OEZ.mjs:43:13)
@Johns-MacBook-Air:providers $ echo $?
1

skilbjo avatar Jan 23 '24 07:01 skilbjo