I have the following two cypress fixtures.
cypress/fixtures/myFixture.js
import Something from "./somewhere";
...
cypress/fixtures/somewhere.ts
export default function Something(): number {
return 1;
}
It's importing a Typescript file from JS, but it gives this error when trying to run the Cypress tests.
Error: Can't walk dependency graph: Cannot find module './somewhere' from '/path/myFixture.js'
I've tried adding tsconfig.json to the cypress folder like I've seen in many Stackoverflow answers, but the error is always that Cypress cannot find somewhere.js when it should be looking at somewhere.ts. I've also tried ts-loader to no avail and Cypress docs say it's supposed to support typescript OOTB (Cypress v10).