Jest is throwing an error stating it cannot find the module specified by path in jest.mock()
> jest
FAIL test/userSelect.test.ts
● Test suite failed to run
Cannot find module '../src/actions/selectUserById' from 'test/userSelect.test.ts'
8 |
9 | jest.mock('mysql');
> 10 | jest.mock('../src/actions/selectUserById');
11 |
12 | const mockSelectUserById = selectUserById as jest.MockedFunction<
13 | typeof selectUserById
at Resolver.resolveModule (node_modules/jest-resolve/build/index.js:306:11)
00:00
at Object.mock (test/userSelect.test.ts:10:6)
The strangest part is this: this test passes on my local machine, but it fails in the CI service we are using.