diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-06-03 11:58:21 +0200 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-03 11:58:21 +0200 | 
| commit | 6d0a9504406524957b351aee748d9f5c8a84c299 (patch) | |
| tree | 1b859015ef5e52b2c7c4e7521f428fb2215df21d /README.md | |
| parent | a8af53c118478e6ed68975c32cc1202b7c7b798e (diff) | |
| parent | fc7a6e98268d34f313d79c817e38c09ad6cde960 (diff) | |
test: add end to end tests (#19)
In addition to Jest tests, I configure Cypress to test some pages and features.
I also fix some Jest errors due to images import.
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 28 | 
1 files changed, 27 insertions, 1 deletions
| @@ -37,7 +37,15 @@ Other contents come from WordPress as headless CMS.  ## Production -In any case, you need a reverse-proxy if you want to bind the live app to a domain. +### First step + +Clone this repo, then: + +```bash +cp .env.example .env +``` + +Then, in any case, you need a reverse-proxy if you want to bind the live app to a domain.  ### With Docker @@ -120,6 +128,24 @@ Once ready, run to update the website translation:  yarn run i18n:compile  ``` +## Testing + +This project is configured to support both [Jest](https://jestjs.io/) and [Cypress](https://docs.cypress.io/) tests with [Testing Library](https://testing-library.com/). + +You can run both tests with `yarn test`. + +### Jest + +The tests are located alongside components (`src/components/`). + +You can run Jest tests with `yarn test:unit`. + +### Cypress + +The tests are located in `tests/cypress/e2e/`. All texts (to find an element) needs to be written in French since Next.js is configured to only accept this language. + +You can run Cypress tests with `yarn test:e2e`. +  ## Licenses  The source code is licensed under the [MIT license](./LICENSE).   | 
