There are two modules, older-dependencies and up-to-date-dependencies. Both are identical except for the versions of certain dependencies including jest, ts-jest, and ts-nameof. However, running npm t in up-to-date-dependencies fails:
> jest
FAIL test/foo.test.ts
● Test suite failed to run
ReferenceError: nameof is not defined
1 | import foo from '../../foo';
2 |
> 3 | describe(nameof(foo), () => {
| ^
4 | it('passes', () => {
5 | expect(true).toBe(true)
6 | })
at Object.<anonymous> (test/foo.test.ts:3:1)
Test Suites: 1 failed, 1 total
Tests: 0 total
Snapshots: 0 total
Time: 3.652 s
Ran all test suites.
npm ERR! Test failed. See above for more details.
However, tests work perfectly when ran in older-dependencies. Both use the setup mentioned here..
I got the same issue "nameof is not defined".
"typescript": "^4.3.4",
"ts-nameof": "^4.2.2",
"@types/ts-nameof": "^4.2.1",
"ttypescript": "^1.5.12"
Setup mentioned here.
Demo Repo
There are two modules,
older-dependencies
andup-to-date-dependencies
. Both are identical except for the versions of certain dependencies including jest, ts-jest, and ts-nameof. However, runningnpm t
inup-to-date-dependencies
fails:However, tests work perfectly when ran in
older-dependencies
. Both use the setup mentioned here..Node v: v14.15.1. OS: Windows.