FalconClientMock component which allows you to setup application context inside unit test environment.
FalconClientMock can receive props for mock version of React context provider components used by
apollo: object- props for
router: objectprops for
asyncComponent: object- props for
i18next: object- props for
helmet: object- props for
Tests should be named
Tests can be run in the command line from your
client directory using
yarn. This will run all tests.
test command will run all tests, you will then have access to the following options:
ato run all tests.
fto run only failed tests.
oto only run tests related to changed files.
pto filter by a filename regex pattern.
tto filter by a test name regex pattern.
qto quit watch mode.
Enterto trigger a test run.
In this example we are testing the
describe() expects 2 arguments,
name will appear in your console to help you identify the tests, we advise using the component name here.
Inside the function (
fn) passed to
describe you can run your tests.
We advise familiarizing yourself with Jest before writing tests.
In this simple test we check that the
<Banner /> component renders
We've created a few example tests and added them to our Cookbook.