mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-29 19:41:16 -05:00
fix: set status property on the module API resolved object (#8799)
This commit is contained in:
@@ -41,6 +41,7 @@ const cypressModuleApi = {
|
||||
.then((output) => {
|
||||
if (!output) {
|
||||
return {
|
||||
status: 'failed',
|
||||
failures: failedTests,
|
||||
message: 'Could not find Cypress test run results',
|
||||
}
|
||||
|
||||
@@ -68,6 +68,24 @@ describe('cypress', function () {
|
||||
})
|
||||
})
|
||||
|
||||
context('.run fails to write results file', function () {
|
||||
it('resolves with error object', function () {
|
||||
const outputPath = path.join(os.tmpdir(), 'cypress/monorepo/cypress_spec/output.json')
|
||||
|
||||
sinon.stub(tmp, 'fileAsync').resolves(outputPath)
|
||||
sinon.stub(run, 'start').resolves(2)
|
||||
sinon.stub(fs, 'readJsonAsync').withArgs(outputPath).resolves()
|
||||
|
||||
return cypress.run().then((result) => {
|
||||
expect(result).to.deep.equal({
|
||||
status: 'failed',
|
||||
failures: 2,
|
||||
message: 'Could not find Cypress test run results',
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
context('.run', function () {
|
||||
let outputPath
|
||||
|
||||
|
||||
Reference in New Issue
Block a user