Patrick
07/28/2021, 1:59 PMawait clock.tickAsync(10000)
I need to mock time to test for cases like correct token expirations etc. Is there something like a timeout in prisma or anything that could cause this error?
StackTrace:
TypeError: Cannot read property 'paused' of undefined
at onBodyTimeout (/home/patrick/Code/xxx/server/node_modules/@prisma/client/runtime/index.js:24829:16)
at callTimer (/home/patrick/Code/xxx/server/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:423:24)
at doTickInner (/home/patrick/Code/xxx/server/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:894:29)
at Immediate.nextPromiseTick (/home/patrick/Code/xxx/server/node_modules/@sinonjs/fake-timers/src/fake-timers-src.js:955:25)
at processImmediate (internal/timers.js:461:21)
at process.topLevelDomainCallback (domain.js:144:15)
at process.callbackTrampoline (internal/async_hooks.js:129:14)
Ryan
07/28/2021, 2:04 PMtickAsync
?Patrick
07/28/2021, 2:06 PMconst token = await getTokenFromMail(mailhog, registerEmail, TokenType.ACTIVATION);
await clock.tickAsync((tokenService.activationTokenExpiration * 60 * 1000) + 100);
const activationResponse = await app.inject().post('/auth/activate').body(new TokenResponseDto({ token }));
Its erroring after calling tickAsync, even before calling the app route itselfRyan
07/28/2021, 2:11 PMtest
block right?Ryan
07/28/2021, 2:11 PMPatrick
07/28/2021, 2:11 PMPatrick
07/28/2021, 2:11 PMimport FakeTimers from '@sinonjs/fake-timers';
Patrick
07/28/2021, 2:37 PM