浏览代码

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
bubble
kyle 5 年前
committed by GitHub
父节点
当前提交
21bb452cb7
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 3 个文件被更改,包括 12 次插入3 次删除
  1. +1
    -1
      package.json
  2. +11
    -1
      test/e2e-cypress/support/index.js
  3. +0
    -1
      webpack-hot-dev-server.config.js

+ 1
- 1
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",


+ 11
- 1
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
})
})

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
})

+ 0
- 1
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


正在加载...
取消
保存