-
Notifications
You must be signed in to change notification settings - Fork 5
Fixing broken tests
First of all, you must make sure that your project is correctly built.
The first thing that may fail is the snapshot of the storybook stories, this is because it must be updated if you make any change to the layout. In order to do so, run yarn test -u
from the valdueza-storybook
package directory.
The key to bugfixing these is narrowing the problem. The describe
and it
blocks can be skipped by appending ".skip" (describe.skip(...
, it.skip(...
), or executed without the others in the same block by appending ".only" (describe.only(...
, it.only(...
).
There are also withChainsDescribe
blocks that only run when the environment variable CHAINS_ENABLED
is set to 1: export CHAINS_ENABLED=1
. The .skip
and .only
functions can also be used with this block.
This lets you run only the tests that you want to fix, so you may enable one at a time and move to the next when you fix it.
You may also further narrow your testing scope by running yarn test-dom
or yarn test-e2e
instead of yarn test
. What is more, you can do yarn test-single <test-file>
in order to check a single file. This, combined with the .skip
and .only
functions, lets you pinpoint the issues more easily.