From 21bb452cb77c6da2a611bf14ad71ef1c5b08ba65 Mon Sep 17 00:00:00 2001 From: kyle Date: Mon, 8 Jul 2019 00:19:40 -0500 Subject: [PATCH] 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 --- package.json | 2 +- test/e2e-cypress/support/index.js | 12 +++++++++++- webpack-hot-dev-server.config.js | 1 - 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 9bec3f03..081adfab 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "test-e2e-selenium": "sleep 3 && nightwatch test/e2e-selenium/scenarios/ --config test/e2e-selenium/nightwatch.json", "e2e-initial-render": "nightwatch test/e2e-selenium/scenarios/ --config test/e2e-selenium/nightwatch.json --group initial-render", "mock-api": "json-server --watch test/e2e-selenium/db.json --port 3204", - "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", + "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", "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", "e2e-cypress": "run-p -r hot-e2e-cypress-server mock-api test-e2e-cypress", "e2e-selenium": "run-p -r hot-e2e-selenium-server mock-api test-e2e-selenium", diff --git a/test/e2e-cypress/support/index.js b/test/e2e-cypress/support/index.js index 83d39ac2..2b949c96 100644 --- a/test/e2e-cypress/support/index.js +++ b/test/e2e-cypress/support/index.js @@ -1,3 +1,5 @@ +import fs from "fs" + // *********************************************************** // This example support/index.js is processed and // loaded automatically before your test files. @@ -24,4 +26,12 @@ import "./commands" // see https://github.com/cypress-io/cypress/issues/95 Cypress.on("window:before:load", win => { win.fetch = null -}) \ No newline at end of file +}) + +Cypress.on("uncaught:exception", (err, runnable) => { + console.log(err) + console.log(JSON.stringify(err, null, 2)) + fs.writeFileSync(require("path").normalize(__dirname, "./error.log"), JSON.stringify(err, null, 2)) + + throw err +}) diff --git a/webpack-hot-dev-server.config.js b/webpack-hot-dev-server.config.js index 49fb6adc..46fcc407 100644 --- a/webpack-hot-dev-server.config.js +++ b/webpack-hot-dev-server.config.js @@ -65,7 +65,6 @@ module.exports = require("./make-webpack-config")(rules, { port: 3200, publicPath: "/", noInfo: true, - hot: true, disableHostCheck: true, // for development within VMs stats: { colors: true