【发布时间】:2017-08-15 19:02:25
【问题描述】:
简而言之,运行我的 jasmine-node 测试无法在相同数组上断言相等,然后给出 NPM 错误 ELIFECYCLE。
这发生在几个测试中,但目前我只运行了一个。
这是模块; https://github.com/Thomas-Elder/hobby.node.happening/blob/mgmt/server/mgmt.js
这是规格; https://github.com/Thomas-Elder/hobby.node.happening/blob/mgmt/spec/server/mgmt_spec.js
目前唯一正在运行的测试是 mgmt_spec.js 文件中的第一个测试。
这是用于测试运行的 npm-debug.log;
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files (x86)\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'test' ]
2 info using npm@2.14.12
3 info using node@v4.2.4
4 verbose run-script [ 'pretest', 'test', 'posttest' ]
5 info pretest happening@0.0.1
6 info test happening@0.0.1
7 verbose unsafe-perm in lifecycle true
8 info happening@0.0.1 Failed to exec test script
9 verbose stack Error: happening@0.0.1 test: `jasmine-node --verbose --captureExceptions --forceexit ./spec`
9 verbose stack Exit status 1
9 verbose stack at EventEmitter.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\lifecycle.js:214:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess.<anonymous> (C:\Program Files (x86)\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:818:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid happening@0.0.1
11 verbose cwd E:\js\apps\happening
12 error Windows_NT 10.0.14393
13 error argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "test"
14 error node v4.2.4
15 error npm v2.14.12
16 error code ELIFECYCLE
17 error happening@0.0.1 test: `jasmine-node --verbose --captureExceptions --forceexit ./spec`
17 error Exit status 1
18 error Failed at the happening@0.0.1 test script 'jasmine-node --verbose --captureExceptions --forceexit ./spec'.
18 error This is most likely a problem with the happening package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error jasmine-node --verbose --captureExceptions --forceexit ./spec
18 error You can get their info via:
18 error npm owner ls happening
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
规范运行,然后建议断言失败,但消息是:
Expected
[ { id : '123', name : 'Tom' },
{ id : '456', name : 'Tim' },
{ id : '789', name : 'Tum' } ]
to equal
[ { id : '123', name : 'Tom' },
{ id : '456', name : 'Tim' },
{ id : '789', name : 'Tum' } ].
哪个不应该失败……它们是相等的数组,对吧?
在失败消息之后,出现 NPM 错误,其详细信息在 npm-debug.log 中重复。
知道这里发生了什么吗?
【问题讨论】:
标签: javascript node.js jasmine-node