提问人:sahil baranwal 提问时间:3/7/2023 最后编辑:sahil baranwal 更新时间:3/7/2023 访问量:209
如何解决“npm ERR!测试失败。有关详细信息,请参阅上文。
How to solve "npm ERR! Test failed. See above for more details."?
问:
我正在使用 javascript 编写 selenium 测试脚本。它在另一个系统中工作。因此,这是运行“npm test”命令时持续存在的错误。
✖ ERROR: Error: Not supported
at Object.exports.doImport (/home/sahil/frontend-selenium-testing/node_modules/mocha/lib/nodejs/esm-utils.js:35:41)
at formattedImport (/home/sahil/frontend-selenium-testing/node_modules/mocha/lib/nodejs/esm-utils.js:32:18)
at exports.requireOrImport (/home/sahil/frontend-selenium-testing/node_modules/mocha/lib/nodejs/esm-utils.js:42:34)
at exports.handleRequires (/home/sahil/frontend-selenium-testing/node_modules/mocha/lib/cli/run-helpers.js:94:34)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
npm ERR! Test failed. See above for more details.
这是我的package.json文件
{
"name": "selenium",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "mocha --no-timeouts --reporter mochawesome --require mochawesome/register"
},
"author": "",
"license": "ISC",
"dependencies": {
"chai": "^4.3.7",
"mocha": "^10.2.0",
"mochawesome": "^7.1.3",
"selenium-webdriver": "^4.7.1"
}
}
这就是我导入包的方式。
const { Builder, By, Key, until } = require("selenium-webdriver")
const assert = require('assert')
const should = require('chai').should()
const { monitorTaskTestFunc } = require('./monitorTask')
const { resolve } = require("path")
const { loginTest } = require("./loginTest")
我使用此链接来设置 chrome webdriver 的路径,在 ubuntu 中设置 chrome webdriver
答: 暂无答案
评论