Cypress and Jest both define the same globals describe
, it
, beforeEach
, etc.
When we run our Jest test suite, nothing prevents it from pulling the global types from Cypress, which will cause the test suite to fail because expect
is different between them.
We should adjust our tsconfig.json
files to prevent that and only pull global types that we actually need instead of the default behaviour of pulling everything.
See this example repo that was setup by the cypress people to show how to separate Jest from Cypress.
Also, something weird can happen where Jest will cause a compilation of typescript files from unrelated plugins when running tests. For example, Jest will fail a test in Timetracking plugin because of an unknown error in AgileDashboard or Document. This request will fix that too.