Skip to content

muratkeremozcan/sinon-vs-jest

Repository files navigation

unit-lint-typecheck-e2e-ct react version cypress version typescript version jest version eslint version prettier version renovate-app badge

A cheat sheet for spying and stubbing with Cypress Sinon vs Jest. The source material for Sinon is from Gleb Bahmutov's Cypress Examples - Spies and Stubs.

yarn install --registry https://registry.yarnpkg.com # specify the registry in case you are using a proprietary registry

# parallel unit, typecheck, lint, format
yarn validate

# no need to have server running for these:
yarn cy:open-ct # for cypress component test runner
yarn cy:run-ct # headless version

# runs the ui and api servers, then opens e2e runner
yarn cy:open-e2e
yarn cy:run-e2e  # headless version

yarn test # run unit tests with jest

CI

build  -->  Cypress e2e test
       -->  Cypress component test
       -->  Typecheck
       -->  Lint
       -->  Unit test

When updating packages, make sure that react-scripts and jest versions stay compatible. Ex: react-scripts latest version uses jest v27, but jest's latest version is 29. Double check node modules or react-scripts docs. The incompatibility may cause tools like WallabyJs to malfunction.

About

Cypress sinon examples vs their counterparts in Jest

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published