Skip to content

Commit

Permalink
feat(cypress): load babel-polyfill before starting
Browse files Browse the repository at this point in the history
`cypress open` lacks some ES6 support (doesn't run the same chrome version as `cypress run`)
  • Loading branch information
topheman committed Apr 24, 2018
1 parent 7c24cb9 commit a36a6a5
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
3 changes: 3 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// https://on.cypress.io/configuration
// ***********************************************************

// cypress lacks support for some method in `cypress open` mode (not same chrome version as in `cypress run`)
import "babel-polyfill";

// Import commands.js using ES2015 syntax:
import "./commands";

Expand Down
25 changes: 25 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
]
},
"devDependencies": {
"babel-polyfill": "^6.26.0",
"cors-anywhere": "^0.4.1",
"cross-env": "^5.1.4",
"cypress": "^2.1.0",
Expand Down
4 changes: 0 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import React from "react";
import ReactDOM from "react-dom";
import { MuiThemeProvider, createMuiTheme } from "material-ui/styles";

// cypress:open doesn't support the following, we need to pollyfill ...
import "mdn-polyfills/Array.prototype.includes";
import "mdn-polyfills/Object.entries";

import "./index.css";
import RootContainer from "./containers/RootContainer";
import registerServiceWorker from "./registerServiceWorker";
Expand Down

0 comments on commit a36a6a5

Please sign in to comment.