mafintosh / mafintosh/why-is-node-running

Source Map line numbers are wrong with mocha and ts-node

Open
#56 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
1.9k
Forks
52
PR merge metrics
No merged PRs in 30d

Description

So as the title says, when I run this package with mocha like so:
`why-is-node-running node_modules/.bin/_mocha --inspect -r ts-node/register 'src/**/*.test.ts'`
or so:
`mocha --inspect -r ts-node/register -r why-is-node-running/include 'src/**/*.test.ts'`
the output points to the wrong line in the ts source files or even the wrong file completely.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the two mocha commands in the report with ts-node/register and src/**/*.test.ts. Trace the source-map handling used by why-is-node-running and verify completion when output consistently points to the correct TypeScript file and line.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, typescript
Domain
devtools, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.