gpt4 book ai didi

node.js - Jasmine 调用绝对没有返回任何内容

转载 作者:太空宇宙 更新时间:2023-11-03 23:04:22 25 4
gpt4 key购买 nike

根据jasmine documentation ,我应该能够运行运行 jasmine 的测试套件。

On this repository即使在将 JASMINE_CONFIG_PATH 导出到 jasmine.json 文件或将其作为参数传递之后,在测试目录中运行 jasmine 也绝对不会执行任何操作。请注意,即使更改测试使其失败,我也没有得到任何结果,没有错误,什么也没有。该命令只是返回到提示符。

这是文件的内容

$ more jasmine.json 
{
"spec_dir": "test",
"stopSpecOnExpectationFailure": false,
"random": false,
"spec_files": ["*spec.js"]
}


(venv) sborini@MacBook-Pro:test (protocol-host-rewrite) [1 stash] $ ls `which jasmine`
/usr/local/bin/jasmine

package.json

{
"version": "1.4.0-dev",
"name": "configurable-http-proxy",
"description": "A configurable-on-the-fly HTTP Proxy",
"author": "Jupyter Developers",
"license": "BSD-3-Clause",
"repository": {
"type": "git",
"url": "https://github.com/jupyterhub/configurable-http-proxy.git"
},
"dependencies": {
"commander": "~2.9",
"http-proxy": "~1.13.2",
"lynx": "^0.2.0",
"strftime": "~0.9",
"winston": "~2.2"
},
"devDependencies": {
"jasmine": "^2.4.1",
"jshint": "^2.9.2",
"nyc": "^6.4.0",
"request": "~2",
"ws": "^1.1"
},
"main": "index.js",
"files": [
"index.js",
"lib/configproxy.js",
"lib/trie.js",
"lib/error/*.html",
"bin/configurable-http-proxy"
],
"bin": {
"configurable-http-proxy": "bin/configurable-http-proxy"
},
"scripts": {
"jshint": "jshint bin/ lib/ test/",
"test": "nyc jasmine JASMINE_CONFIG_PATH=test/jasmine.json",
"coverage-html": "nyc report --reporter=html",
"codecov": "nyc report --reporter=lcov && codecov"
}
}

请注意,使用 npm run test 调用它确实会产生覆盖率的输出,但如果我测试出错,它只会产生以下输出

(venv) sborini@MacBook-Pro:configurable-http-proxy (protocol-host-rewrite) [1 stash] $ npm run test

> configurable-http-proxy@1.4.0-dev test /Users/sborini/Work/github/stefanoborini/configurable-http-proxy
> nyc jasmine JASMINE_CONFIG_PATH=test/jasmine.json

-----------------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
-----------------|----------|----------|----------|----------|----------------|
lib/ | 89.9 | 75 | 83.58 | 90.36 | |
configproxy.js | 87.01 | 64.81 | 84.78 | 87.6 |... 436,437,444 |
testutil.js | 93.83 | 93.75 | 73.33 | 93.83 |... 114,116,117 |
trie.js | 96.72 | 95 | 100 | 96.72 | 15,19 |
-----------------|----------|----------|----------|----------|----------------|
All files | 89.9 | 75 | 83.58 | 90.36 | |
-----------------|----------|----------|----------|----------|----------------|


npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/5.10.1/bin/node" "/usr/local/bin/npm" "run" "test"
npm ERR! node v5.10.1
npm ERR! npm v3.8.3
npm ERR! code ELIFECYCLE
npm ERR! configurable-http-proxy@1.4.0-dev test: `nyc jasmine JASMINE_CONFIG_PATH=test/jasmine.json`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the configurable-http-proxy@1.4.0-dev test script 'nyc jasmine JASMINE_CONFIG_PATH=test/jasmine.json'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the configurable-http-proxy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! nyc jasmine JASMINE_CONFIG_PATH=test/jasmine.json
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs configurable-http-proxy
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls configurable-http-proxy
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/sborini/Work/github/stefanoborini/configurable-http-proxy/npm-debug.log

这并没有告诉我任何有关实际失败测试的信息。

最佳答案

对于所有 Google 用户,这是 jasmine 中的一个错误。

https://github.com/jasmine/jasmine-npm/issues/90

安装并使用旧版本:

npm install jasmine@~2.4

这有效。

关于node.js - Jasmine 调用绝对没有返回任何内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39357919/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com