Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appears to not work with [email protected]: ReferenceError: nameof is not defined #119

Open
andrewkolos opened this issue Aug 21, 2021 · 1 comment

Comments

@andrewkolos
Copy link

Demo Repo

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..

Node v: v14.15.1.
OS: Windows.

@RimApp
Copy link

RimApp commented Sep 12, 2021

Hi,

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.

Any solution ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants