In order to run this locally
yarn install
- installs the root projectyarn build
- This will build the projectyarn watch
- This will build the project and watch the folder output for Hot-Reloadingyarn run dist:ci
- This will build the project and run unit testsyarn link
- links the root project so the locally developed package can be referenced in other buildsyarn run example:link
- links the example project with our local build outputyarn run example:install
- installs the examples dependenciesyarn run example:test:unit
- Uses Jest, and MSW Server to provide a mock provider, and executes unit tests, recording interactions in a Pact Fileyarn run example:test:cy:run
- Uses Jest, and MSW Server to provide a mock provider, and executes unit tests, recording interactions in a Pact Fileyarn run example:test:cy:run
- Uses Cypress, and MSW Worker to provide a mock provider, and executes unit tests, recording interactions in a Pact Fileyarn run example:test:cy:open
- Allows you to run the above step, but with Cypress in Watch mode
Run this to check everything is working e2e locally, these steps are run on every GitHub actions builds ./github/workflows/build-and-test.yml
yarn install
yarn run dist:ci
yarn link
yarn run example:link
yarn run example:install
yarn run example:test:unit
yarn run example:test:cy:run
There are two types of mocking provided, MSW Worker & MSW Server
- MSW Worker (Browser Based) - With Cypress
- MSW Server (Node Based) - With Jest
You need two terminal windows
Terminal 1
yarn watch
Terminal 2
Cypress Interactive Mode - Watch
yarn run example:test:cy:open
or
Cypress Run Mode - Once
yarn run example:test:cy:run
yarn run example:test:unit