I was trying to test a new feature then I've faced this:
Cannot find module 'drivers/behpardakht' from 'src/drivers.ts'
Require stack:
src/drivers.ts
src/drivers/behpardakht/behpardakht.spec.ts
> 1 | import { Behpardakht, BehpardakhtAPI } from 'drivers/behpardakht';
| ^
2 | import { IdPay, IdPayAPI } from 'drivers/idpay';
3 | import { NextPay, NextPayAPI } from 'drivers/nextpay';
4 | import { Parsian, ParsianAPI } from 'drivers/parsian';
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:487:11)
at Object.<anonymous> (src/drivers.ts:1:1)
at Object.<anonymous> (src/drivers/behpardakht/behpardakht.spec.ts:1:1)
The results are the same while testing every other driver.
To reproduce:yarn test
Expected behavior: run the tests without error
Fix: bringing back ./ to import routes in drivers.ts seems to have fixed the issue for me
How ever yarn prebuild and yarn build have no problem. I'm starting to think there's something wrong with my own general jest config cause it had happened before.
If the tests are generally failing for every one, let me know to create a pull request
Happens for me as well - must have broken when moving the test files.
I'll fix it and add you as a co-author. Having you do it might result in some conflicts as I'm making a bunch of huge changes right now.
I was trying to test a new feature then I've faced this:
The results are the same while testing every other driver.
To reproduce:
yarn test
Expected behavior: run the tests without error
Fix: bringing back
./
to import routes indrivers.ts
seems to have fixed the issue for meHow ever
yarn prebuild
andyarn build
have no problem. I'm starting to think there's something wrong with my own general jest config cause it had happened before.If the tests are generally failing for every one, let me know to create a pull request