Jestjs 当Jest测试用例失败或抛出错误时,Gitlab管道没有失败

Jestjs 当Jest测试用例失败或抛出错误时,Gitlab管道没有失败,jestjs,gitlab-ci,gitlab-ci-runner,testcase,Jestjs,Gitlab Ci,Gitlab Ci Runner,Testcase,我使用Jest测试mu nodejs代码,在提交代码之后,管道运行,Jest测试用例抛出错误,但管道没有失败。 在测试用例中,它显示并没有预期的结果,所以测试用例失败了,但并没有迫使gitlab管道失败。有什么帮助吗 ✓ (10 ms) ✓ Test case for creating patient form testing (12 ms) Test Suites: 1 passed, 1 total Tests: 2 passed, 2 total Snapshots

我使用Jest测试mu nodejs代码,在提交代码之后,管道运行,Jest测试用例抛出错误,但管道没有失败。 在测试用例中,它显示并没有预期的结果,所以测试用例失败了,但并没有迫使gitlab管道失败。有什么帮助吗

  ✓  (10 ms)
  ✓ Test case for creating patient form testing (12 ms)

Test Suites: 1 passed, 1 total
Tests:       2 passed, 2 total
Snapshots:   0 total
Time:        3.174 s
Ran all test suites matching /patient_create.test.js/i.
(node:18484) UnhandledPromiseRejectionWarning: Error: expect(received).not.toBeDefined()

Received: [Error: expect(received).toBe(expected) // Object.is equality·
Expected: 200
Received: 404]```