CRA2 recommended config hits random break points in VS Code
Created by: ryan-mars
Is this a bug report?
Yes
Did you try recovering your dependencies?
Yes
npm --version
6.4.1
yarn --version
1.10.1
Which terms did you search for in User Guide?
"vs code" debugger breakpoints
Environment
System:
OS: macOS 10.14
CPU: x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Binaries:
Node: 10.10.0 - ~/.nvm/versions/node/v10.10.0/bin/node
Yarn: 1.10.1 - ~/.nvm/versions/node/v10.10.0/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.10.0/bin/npm
Browsers:
Chrome: 69.0.3497.100
Safari: 12.0
npmPackages:
react: ^16.5.2 => 16.5.2
react-dom: ^16.5.2 => 16.5.2
react-scripts: 2.0.4 => 2.0.4
npmGlobalPackages:
create-react-app: 2.0.2
Steps to Reproduce
- Install VS Code 1.27.2 or 1.26.1
npx create-react-app debug-cra2
- Add recommended Debug CRA Tests snippet to
.vscode/launch.json
- Add the snippet below to
src/App.test.js
- Set breakpoint on line 13
console.log({ foo })
- Hit
F5
and debug
Snippet for App.test.js
it('should find the breakpoint', () => {
const foo = 'bar'
console.log({ foo })
expect(foo).toBe('bar')
})
it('should find the other breakpoint', () => {
const foo = 'bar'
console.log({ foo })
expect(foo).toBe('bar')
})
Expected Behavior
Execution stops on line 13
Actual Behavior
Execution stops on line 6 or 7, it's inconsistent.