Skip to content

JEST tests complete successfully but returns exit status 1 #9324

@muthukrishnanm

Description

@muthukrishnanm

I run JEST tests using npm run test:jest and the corresponding entry in package.json is

"test:jest": "jest --config=./jest.config.js",

All tests run successfully, but returns with exit code 1

Test Suites: 1 skipped, 106 passed, 106 of 107 total
Tests:       10 skipped, 657 passed, 667 total
Snapshots:   14 files obsolete, 0 total
Time:        34.453s
Ran all test suites.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @vc/[email protected] test:jest: `jest --config=./jest.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @vc/[email protected] test:jest script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/.npm/_logs/2019-12-18T13_01_11_869Z-debug.log

10 silly lifecycle @vc/[email protected]~test:jest: Args: [ '-c', 'jest --config=./jest.config.js' ]
11 silly lifecycle @vc/[email protected]~test:jest: Returned: code: 1  signal: null
12 info lifecycle @vc/[email protected]~test:jest: Failed to exec test:jest script
13 verbose stack Error: @vc/[email protected] test:jest: `jest --config=./jest.config.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:915:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid @vc/[email protected]
15 verbose cwd /workspace/vc.src/vco/src/server/node
16 verbose Linux 3.13.0-163-generic
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "test:jest"
18 verbose node v8.17.0
19 verbose npm  v6.13.4
20 error code ELIFECYCLE
21 error errno 1
22 error @vc/[email protected] test:jest: `jest --config=./jest.config.js`
22 error Exit status 1
23 error Failed at the @vc/[email protected] test:jest script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

I am not sure why the process exits with status code 1 even though all tests pass.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions