2017-03-23 6 views
0

으로 전달 테스트에 실패했습니다. 내 재스민 노드 테스트를 실행하는 간단한 이야기가 동일한 어레이에 대한 동일성 주장에 실패한 다음 ELIFECYCLE NPM 오류가 발생합니다.재스민 노드가 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는 다음과 같습니다. 바로, 그들이 동일한 배열있어 ...

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' } ]. 

어떤 실패 안 :

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 [email protected] 
3 info using [email protected] 
4 verbose run-script [ 'pretest', 'test', 'posttest' ] 
5 info pretest [email protected] 
6 info test [email protected] 
7 verbose unsafe-perm in lifecycle true 
8 info [email protected] Failed to exec test script 
9 verbose stack Error: [email protected] 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 [email protected] 
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 [email protected] test: `jasmine-node --verbose --captureExceptions --forceexit ./spec` 
17 error Exit status 1 
18 error Failed at the [email protected] 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 ] 

사양은 실행 한 다음 선언이 실패한 것을 권고하지만, 메시지는?

오류 메시지 다음에 npm-debug.log에 세부 사항이 반복되는 NPM 오류가 있습니다.

실마리가 어떤 단서입니까?

답변

0

좋아, 그래서 나는 이것을 다소 분류했다. 내가 겪고있는 문제는 NPM 오류와 관련이 없습니다. 스펙이 실패한 이유는 객체 리터럴을 생성자를 사용하여 생성 된 객체와 비교했기 때문입니다.

이것은 스펙 주자를 jasmine (jasmine-node에서)으로 최종적으로 업데이트했을 때 분명해졌습니다. Jasmine의 로깅 결과는 다음과 같습니다.

Expected 
[ ({ id: '123', name: 'Tom' }), ({ id: '456', name: 'Tim' }), ({ id:'789', name: 'Tum' }) ] 
to equal 
[ Object({ id: '123', name: 'Tom' }), Object({ id: '456', name: 'Tim' }), Object({ id: '789', name: 'Tum' }) ] 

은 제가 사양을 설정 줄 방법을 찾고 및 사양 (위의 repo 링크 참조) 개정 후했다, 그것은 통과시켰다.

ELIFECYCLE 오류는 사양이 실패 할 때마다 발생하는 것으로 보입니다.