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

__TC_CONFIG__ in package.json jest.globals #22

Closed
gizak opened this issue Oct 13, 2016 · 1 comment
Closed

__TC_CONFIG__ in package.json jest.globals #22

gizak opened this issue Oct 13, 2016 · 1 comment
Assignees
Labels

Comments

@gizak
Copy link

gizak commented Oct 13, 2016

node: v6.8.0
jest: v16.0.1
ts-jest: 0.1.7

First of all, thank you for this package, it saves me alot!

I spotted a bug (or did I miss anything?):
If __TC_CONFIG__ doesn't appear in package.json, the line number mapping won't pass to stack trace messages.

To reproduce this, delete the __TC_CONFIG__ section in tests/simple/package.json and under dir tests/simple run jest:

 FAIL  __tests__/Hello.test.ts
  ● Hello Class › should throw an error on line 11

    Hello error!

      at new Hello (Hello.ts:5:15)
      at Object.<anonymous> (__tests__/Hello.test.ts:5:21)

  Hello Class
    ✕ should throw an error on line 11 (7ms)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        0.918s, estimated 1s
Ran all test suites.

Note that the line at new Hello (Hello.ts:5:15) was at new Hello (Hello.ts:11:15) before changing package.json

However if I add the __TS_CONFIG__:{} back into config, everything is working normal:

 FAIL  __tests__/Hello.test.ts
  ● Hello Class › should throw an error on line 11

    Hello error!

      at new Hello (Hello.ts:11:11)
      at Object.<anonymous> (Hello.test.ts:9:19)

  Hello Class
    ✕ should throw an error on line 11 (113ms)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 1 total
Snapshots:   0 total
Time:        0.973s, estimated 1s
Ran all test suites.

If I understand correctly, __TC_CONFIG__ is mean to override tsconfig settings, so we should expect ts-jest works out-of-box without providing a __TC_CONFIG__?

@gizak gizak changed the title __TC_CONFIG__ in package.json jest.globals __TC_CONFIG__ in package.json jest.globals Oct 13, 2016
@Igmat Igmat added the 🐛 Bug label Oct 14, 2016
@Igmat Igmat self-assigned this Oct 14, 2016
Igmat added a commit to Igmat/ts-jest that referenced this issue Oct 14, 2016
Igmat added a commit that referenced this issue Oct 14, 2016
Fixing tsconfig issues. #22
@Igmat
Copy link
Contributor

Igmat commented Oct 14, 2016

ts-jest: 0.1.8 should solve this now.

@Igmat Igmat closed this as completed Oct 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants