question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

line number is mismatch when use console.log

See original GitHub issue

thank you for great tool! i use console.log in test code. but line number mismatch. i created test project. here https://github.com/m0a-mystudy/typescript/blob/master/jest-line-number/line-number.test.ts

out put is here

FAIL  ./line-number.test.ts
  ● line number test

    SyntaxError: test error line:3

      at Suite.<anonymous> (line-number.test.ts:3:14)
      at Object.<anonymous> (line-number.test.ts:2:5)
          at Promise (<anonymous>)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:169:7)

  ● line number test2

    SyntaxError: test error line:10

      at Suite.<anonymous> (line-number.test.ts:10:14)
      at Object.<anonymous> (line-number.test.ts:9:5)
          at Promise (<anonymous>)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:169:7)

  ✕ line number test (115ms)
  ✕ line number test2 (17ms)
  ✓ line number test4 (1ms)

Test Suites: 1 failed, 1 total
Tests:       2 failed, 1 passed, 3 total
Snapshots:   0 total
Time:        1.462s, estimated 2s
Ran all test suites.
  console.log line-number.test.ts:14
    hello line:17

output console.log line-number.test.ts:14 line number mismatch. why?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
GeeWeecommented, Jul 31, 2017

That’s definitely a good idea. Maybe source-map-support would be interested?

0reactions
kulshekharcommented, Mar 2, 2018

Closing as there’s nothing we can do about this in ts-jest

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does console.log give the line number but console.error ...
The line number is showing as index.js:1 because your source has probably been put through a preprocessor and by the time the browser...
Read more >
Exception stack trace source map line numbers mismatch
component.ts . This means that sourcemap is processed incorrectly on our side, i.e. kibana/apm-server. There might be a bug in our sourcemap ...
Read more >
console.log with line numbers | Kai Hao
So lots of things is happening here, in short, the basic idea is that we can get the line number through stack trace...
Read more >
Error.prototype.lineNumber - JavaScript - MDN Web Docs
The lineNumber data property of an Error instance contains the line number in the file that raised this error.
Read more >
Troubleshooting common AWS CDK issues
This topic describes how to troubleshoot the following issues with the AWS CDK. After updating the AWS CDK, the AWS CDK Toolkit (CLI)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found