Skip to content

Commit 21bb452

Browse files
authored
housekeeping: address inconsistently truncated JS asset responses within Cypress tests (via #5445)
* add Cypress error trace * Update package.json * Update webpack-hot-dev-server.config.js * Update index.js * Update index.js
1 parent 17ba2c6 commit 21bb452

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"test-e2e-selenium": "sleep 3 && nightwatch test/e2e-selenium/scenarios/ --config test/e2e-selenium/nightwatch.json",
3838
"e2e-initial-render": "nightwatch test/e2e-selenium/scenarios/ --config test/e2e-selenium/nightwatch.json --group initial-render",
3939
"mock-api": "json-server --watch test/e2e-selenium/db.json --port 3204",
40-
"hot-e2e-cypress-server": "webpack-dev-server --port 3230 --content-base test/e2e-cypress/static --host 0.0.0.0 --config webpack-hot-dev-server.config.js --inline --hot --progress",
40+
"hot-e2e-cypress-server": "webpack-dev-server --port 3230 --content-base test/e2e-cypress/static --host 0.0.0.0 --config webpack-hot-dev-server.config.js",
4141
"hot-e2e-selenium-server": "webpack-dev-server --port 3230 --content-base test/e2e-selenium/helpers --host 0.0.0.0 --config webpack-hot-dev-server.config.js --inline --hot --progress",
4242
"e2e-cypress": "run-p -r hot-e2e-cypress-server mock-api test-e2e-cypress",
4343
"e2e-selenium": "run-p -r hot-e2e-selenium-server mock-api test-e2e-selenium",

test/e2e-cypress/support/index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import fs from "fs"
2+
13
// ***********************************************************
24
// This example support/index.js is processed and
35
// loaded automatically before your test files.
@@ -24,4 +26,12 @@ import "./commands"
2426
// see https://github.com/cypress-io/cypress/issues/95
2527
Cypress.on("window:before:load", win => {
2628
win.fetch = null
27-
})
29+
})
30+
31+
Cypress.on("uncaught:exception", (err, runnable) => {
32+
console.log(err)
33+
console.log(JSON.stringify(err, null, 2))
34+
fs.writeFileSync(require("path").normalize(__dirname, "./error.log"), JSON.stringify(err, null, 2))
35+
36+
throw err
37+
})

webpack-hot-dev-server.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ module.exports = require("./make-webpack-config")(rules, {
6565
port: 3200,
6666
publicPath: "/",
6767
noInfo: true,
68-
hot: true,
6968
disableHostCheck: true, // for development within VMs
7069
stats: {
7170
colors: true

0 commit comments

Comments
 (0)