M
M
magary42021-05-10 12:34:02
Node.js
magary4, 2021-05-10 12:34:02

Why does the nodejs debugger stop at the wrong place where I put a breakpoint?

I run jest test inside
jest.config docker container:

module.exports = {
  testEnvironment: 'node',
  setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
  moduleFileExtensions: ['ts', 'js', 'json'],
  testRegex: '\\.spec.(ts|js)$',
  testPathIgnorePatterns: ['/node_modules/', '/dist/', '/migration/'],
  globals: {
    'ts-jest': {
      tsconfig: './tsconfig.test.json'
    }
  },
  preset: 'ts-jest'
};


I set breakpoints inside vscode - it doesn't stop there, because they are not bound, but it stops if you write the word debugger in the code, but it stops not in the file itself, but in some “xxx.ts (readonly inlined content from source map)”
themselves the red dots of breakpoints are placed in strange places between words (see the figure)
6098fe8cbec81226078495.png
 the problem, as I understand it, is that this ts-jest compiler does not make outDir so that you can map to this directory,

how to be?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question