fix(cypress): tests should fail on uncaught exception (#6308)

* also remove broken file logging

ref #6305
This commit is contained in:
Tim Lai
2020-08-17 13:58:57 -07:00
committed by GitHub
parent 168d0ae7ac
commit 471c24dfcb

View File

@@ -1,5 +1,3 @@
import fs from "fs"
// *********************************************************** // ***********************************************************
// This example support/index.js is processed and // This example support/index.js is processed and
// loaded automatically before your test files. // loaded automatically before your test files.
@@ -29,9 +27,6 @@ Cypress.on("window:before:load", win => {
}) })
Cypress.on("uncaught:exception", (err, runnable) => { Cypress.on("uncaught:exception", (err, runnable) => {
console.log(err)
console.log(JSON.stringify(err, null, 2)) console.log(JSON.stringify(err, null, 2))
fs.writeFileSync(require("path").normalize(__dirname, "./error.log"), JSON.stringify(err, null, 2)) return true
throw err
}) })