test-runner
test-runner copied to clipboard
add `--testTimeout` cli option from jest
Thanks for the work on this great library!
We are using it and are experiencing errors like:
thrown: "Exceeded timeout of 15000 ms for a test.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."
We've tried the --maxWorkers suggestion from the docs. Instead of ejecting and updating the testTimeout, we would prefer to pass it via our jenkins script (which runs on the CI where our tests are timing out- they work fine locally without the timeout).
Before this PR, running test-storybook --testTimeout 20000 results in:
error: unknown option '--testTimeout'
Afterwards, it will work.
To test this PR, I ran yarn build, and then tested a few commands:
set test timeout to 20ms (it should fail):
./dist/test-storybook.js --testTimeout=20
set test timeout to 20s (it should pass):
./dist/test-storybook.js --testTimeout=20_000
I was just reading through some of the issues logged in this repo, and found: https://github.com/storybookjs/test-runner/issues/328
So I think this PR isn't strictly needed.
While this command errors:
test-storybook --testTimeout 20000
I think this works:
test-storybook -- --testTimeout 20000
So feel free to close this PR. But I'm also fine with it still being merged (so both of the commands above work).
@skratchdot What version of the test runner are you using? 0.16.0 should allow any jest option without the additional -- .
@skratchdot What version of the test runner are you using? 0.16.0 should allow any jest option without the additional -- .
@bryanjtc - We are using v16
Again, this works:
test-storybook -- --testTimeout 20000
This errors:
test-storybook --testTimeout 20000
You should be able to test by checking out the next branch (or v0.16.0 tag) and running:
yarn build
./dist/test-storybook.js --testTimeout 20000
which will show:
error: unknown option '--testTimeout'
and:
If you'd like this option to be supported, please open an issue at https://github.com/storybookjs/test-runner/issues/new
test-storybook -- --testTimeout 20000
That works for me, thank you @skratchdot
Thanks a lot for your contribution @skratchdot !!