I want to import some constants from my project into my tests (for instance to test localstorage
operations). While using import
(or require
) from my IDE doesn't show errors:
When running Cypress I get: Error: Cannot find module
The module is in TypeScript (Config.ts) despite doesn't use any particular feature.
I didn't modify any of the Command or Support script. But I have in the Cypress folder a tsconfig.json so that my Create React App can run without conflict with Jest.
{
"extends": "../tsconfig",
"include": ["../node_modules/cypress/types", "**/*.ts"]
}
I tried to add ../src or ../src/**/*.ts in the include
but nothing seem to work.
What am I doing wrong? Thanks!