ОШИБКА рабочая сила: молния:lwc:test:setup: не удается прочитать свойство 'error', равное нулю
Я завершаю модуль "Настройка Jest Testing Framework" для следа "Тесты веб-компонентов Lightning", и когда я пытаюсь выполнить "sfdx force:lightning:lwc:test:setup", у меня возникает ошибка что я не могу понять.
ошибка
test-lwc sfdx force:lightning:lwc:test:setup
One or more of the following package.json scripts already exists, skipping adding of test scripts: "test:unit", "test:unit:debug", "test:unit:watch"
Jest configuration found in jest.config.js. Skipping creation of new config file.
Updating files...
logFileUpdatesEnd
Installing @salesforce/sfdx-lwc-jest node package...
npm WARN deprecated rollup-plugin-replace@2.2.0: This module has moved and is now available at @rollup/plugin-replace. Please update your dependencies. This version is no longer maintained.
npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
+ @salesforce/sfdx-lwc-jest@0.7.1
updated 1 package and audited 1033 packages in 21.915s
26 packages are looking for funding
run `npm fund` for details
found 2 vulnerabilities (1 moderate, 1 high)
run `npm audit fix` to fix them, or `npm audit` for details
ERROR running force:lightning:lwc:test:setup: Cannot read property 'error' of null
Конфигурация - MacOS Catalina 10.15.5
//sfdx-project.json:
{
"packageDirectories": [
{
"path": "force-app",
"default": true
}
],
"namespace": "",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "48.0"
}
//launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Jest Tests",
"type": "node",
"request": "launch",
"runtimeArgs": [
"--inspect-brk",
"${workspaceRoot}/node_modules/.bin/jest",
"--runInBand"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"port": 9229
}
]
}
//package.json
{
"name": "salesforce-app",
"private": true,
"version": "1.0.0",
"description": "Salesforce App",
"scripts": {
"lint": "npm run lint:lwc",
"lint:lwc": "eslint force-app/main/default/lwc",
"test": "npm run test:unit",
"test:unit": "sfdx-lwc-jest",
"test:unit:watch": "sfdx-lwc-jest --watch",
"test:unit:debug": "sfdx-lwc-jest --debug",
"test:unit:coverage": "sfdx-lwc-jest --coverage",
"prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"",
"prettier:verify": "prettier --list-different \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\""
},
"devDependencies": {
"@prettier/plugin-xml": "^0.7.2",
"@salesforce/eslint-config-lwc": "^0.5.0",
"@salesforce/sfdx-lwc-jest": "^0.7.1",
"eslint": "^6.8.0",
"prettier": "^2.0.5",
"prettier-plugin-apex": "^1.4.0"
},
"dependencies": {}
}
Что я пробовал
- обновление ссылок из
@salesforce/lwc-jest
к@salesforce/sfdx-lwc-jest
и обновлениеlaunch.json
для разработки в vscode, как указано здесь - обновление sfdx с v47.0 до v48.0
- Бег
npm audit fix
- обновление изношенных узловых модулей