Replies: 1 comment 1 reply
-
Did you check https://vitest.dev/api/vi.html#vi-setconfig? This might work: - jest.setTimeout(200000 + getDelayPerFile(testPath) * 1000);
+ vi.setConfig({ testTimeout: 200000 + getDelayPerFile(testPath) * 1000 }); |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
We are running multiple test suites in parallel, with delayed execution meaning
A.test.ts
andB.test.ts
will start together, andA.test.ts
will execute step immediately, butB.test.ts
will sleep() 30 seconds, before executing steps (this is how you test cloud apps, in env you don't have control over, which does not like bots).So timeout for test suite A is 60 seconds, and for test suite B is 60 + 30 seconds. We have many test suites, so we calculate timeout dynamically.
We are in a process of migrating from Jest to Vitest 🤡 and we used to use this
jest.setTimeout()
to dynamically set timeout inside test suite.helper.ts
A.test.ts
But now things start to get tricky:
beforeAll(ctx)
So any ideas for solution here, which would allow us manipulate timeout for every single test suite? I think actually we need to manipulate
hookTimeout
, since wait will happen insidebeforeAll
. Once tests will run, it will run normally, without delay.Beta Was this translation helpful? Give feedback.
All reactions