Я пытался отладить тесты, созданные с помощью create-реагировать-приложение / jest / энзим, и не могу достичь точки останова в VScode.Когда я запускаю отладку «Debug CRA Tests», все виды работ и тестов проходят, но это не достигает точки останова в VSCode.
Я что-то пропустил в моей конфигурации / настройке?
import React from "react";
import { configure, shallow } from "enzyme";
import Adapter from "enzyme-adapter-react-16";
import Input from "./Input";
configure({ adapter: new Adapter() });
describe("<Input />", () => {
it("should render <Input label=.../> with label", () => {
const wrapper = shallow(<Input elementType="input" />);
wrapper.setProps({ label: "test" });
expect(wrapper.find("label")).toHaveLength(1);
});
});
и есть мой launch.json:
{
"name": "Debug CRA Tests",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/react-scripts",
"args": [
"test",
"--runInBand",
"--no-cache"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
и мой package.json:
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.6",
"@fortawesome/free-solid-svg-icons": "^5.4.1",
"@fortawesome/react-fontawesome": "^0.1.3",
"axios": "^0.18.0",
"moment": "^2.22.2",
"react": "^16.6.0",
"react-dom": "^16.6.0",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"react-scripts": "2.0.5",
"react-swipeable": "^4.3.0",
"redux": "^4.0.1",
"redux-saga": "^0.16.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.6.0",
"node-sass": "^4.9.4"
}
....