Skip to content

Commit

Permalink
feat: Change default preprocessor to webpack (#7982)
Browse files Browse the repository at this point in the history
* make tests preprocessor agnostic

* update eslintignore

* put back deps needed for e2e test

* remove obselete snapshot

it was replaced by 1_typescript_support_spec.ts.js

* switch from browserify to webpack preprocessor

* cmon github

* fix/update tests

* bump preprocessor and update snapshots

* update snapshots

* bump preprocessor to gain json support

* fix e2e tests with webpack-originated errors

* bump preprocessor version, fix node globals

* update snapshot

* remove support for ? in file path

* bump preprocessor version

* bump preprocessor again

* bump preprocessor

* bump preprocessor

* update snapshots

* bump preprocessor version

* bump preprocessor, quiet the paths plugin

* add test verifying tsconfig paths work

* bump batteries-included preprocessor and install latest webpack preprocessor beside it

* update snapshots

* put back snapshot

* update snapshot

* update snapshot

Co-authored-by: Brian Mann <[email protected]>
  • Loading branch information
chrisbreiding and brian-mann authored Aug 10, 2020
1 parent 6c15dde commit 474bcdd
Show file tree
Hide file tree
Showing 32 changed files with 518 additions and 656 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ packages/server/lib/scaffold/plugins/index.js
packages/server/lib/scaffold/support/index.js
packages/server/lib/scaffold/support/commands.js
packages/server/test/support/fixtures/projects/e2e/cypress/integration/stdout_exit_early_failing_spec.js
packages/server/test/support/fixtures/projects/e2e/cypress/integration/browserify_typescript_failing_spec.ts
packages/server/test/support/fixtures/projects/e2e/cypress/integration/typescript_failing_spec.ts

**/.projects
**/*.d.ts
Expand Down
13 changes: 12 additions & 1 deletion packages/server/__snapshots__/1_busted_support_file_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,18 @@ Oops...we found an error preparing this test file:
The error was:
Error: Cannot find module './does/not/exist' from '/foo/bar/.projects/busted-support-file/cypress/support'
Error: Webpack Compilation Error
./cypress/support/index.js
Module not found: Error: Can't resolve './does/not/exist' in '/foo/bar/.projects/busted-support-file/cypress/support'
Looked for and couldn't find the file at the following paths:
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist]
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.js]
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.json]
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.jsx]
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.coffee]
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.ts]
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.tsx]
@ ./cypress/support/index.js 3:0-27
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
exports['e2e browserify, babel, es2015 passes 1'] = `
exports['e2e es modules passes 1'] = `
====================================================================================================
Expand All @@ -7,14 +7,14 @@ exports['e2e browserify, babel, es2015 passes 1'] = `
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 1.2.3 │
│ Browser: FooBrowser 88 │
│ Specs: 1 found (browserify_babel_es2015_passing_spec.coffee) │
│ Searched: cypress/integration/browserify_babel_es2015_passing_spec.coffee │
│ Specs: 1 found (es_modules_in_coffee_spec.coffee)
│ Searched: cypress/integration/es_modules_in_coffee_spec.coffee
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: browserify_babel_es2015_passing_spec.coffee (1 of 1)
Running: es_modules_in_coffee_spec.coffee (1 of 1)
imports work
Expand All @@ -37,15 +37,15 @@ exports['e2e browserify, babel, es2015 passes 1'] = `
│ Screenshots: 0 │
│ Video: true │
│ Duration: X seconds │
│ Spec Ran: browserify_babel_es2015_passing_spec.coffee │
│ Spec Ran: es_modules_in_coffee_spec.coffee
└────────────────────────────────────────────────────────────────────────────────────────────────┘
(Video)
- Started processing: Compressing to 32 CRF
- Finished processing: /XXX/XXX/XXX/cypress/videos/browserify_babel_es2015_passing (X second)
_spec.coffee.mp4
- Finished processing: /XXX/XXX/XXX/cypress/videos/es_modules_in_coffee_spec.coffe (X second)
e.mp4
====================================================================================================
Expand All @@ -55,15 +55,14 @@ exports['e2e browserify, babel, es2015 passes 1'] = `
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✔ browserify_babel_es2015_passing_spe XX:XX 3 3 - - - │
│ c.coffee │
│ ✔ es_modules_in_coffee_spec.coffee XX:XX 3 3 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✔ All specs passed! XX:XX 3 3 - - -
`

exports['e2e browserify, babel, es2015 fails 1'] = `
exports['e2e es modules fails 1'] = `
====================================================================================================
Expand All @@ -72,26 +71,31 @@ exports['e2e browserify, babel, es2015 fails 1'] = `
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 1.2.3 │
│ Browser: FooBrowser 88 │
│ Specs: 1 found (browserify_babel_es2015_failing_spec.js) │
│ Searched: cypress/integration/browserify_babel_es2015_failing_spec.js │
│ Specs: 1 found (es_module_import_failing_spec.js)
│ Searched: cypress/integration/es_module_import_failing_spec.js
└────────────────────────────────────────────────────────────────────────────────────────────────┘
────────────────────────────────────────────────────────────────────────────────────────────────────
Running: browserify_babel_es2015_failing_spec.js (1 of 1)
Running: es_module_import_failing_spec.js (1 of 1)
Oops...we found an error preparing this test file:
/foo/bar/.projects/e2e/cypress/integration/browserify_babel_es2015_failing_spec.js
/foo/bar/.projects/e2e/cypress/integration/es_module_import_failing_spec.js
The error was:
Error: Webpack Compilation Error
./lib/fail.js
Module build failed (from [..]):
SyntaxError: /foo/bar/.projects/e2e/lib/fail.js: Unexpected token (2:0)
1 | export default {
> 2 |
| ^ while parsing file: /foo/bar/.projects/e2e/lib/fail.js
| ^
@ ./cypress/integration/es_module_import_failing_spec.js 3:0-25
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
Expand All @@ -111,15 +115,15 @@ Fix the error in your code and re-run your tests.
│ Screenshots: 0 │
│ Video: true │
│ Duration: X seconds │
│ Spec Ran: browserify_babel_es2015_failing_spec.js │
│ Spec Ran: es_module_import_failing_spec.js
└────────────────────────────────────────────────────────────────────────────────────────────────┘
(Video)
- Started processing: Compressing to 32 CRF
- Finished processing: /XXX/XXX/XXX/cypress/videos/browserify_babel_es2015_failing (X second)
_spec.js.mp4
- Finished processing: /XXX/XXX/XXX/cypress/videos/es_module_import_failing_spec.j (X second)
s.mp4
====================================================================================================
Expand All @@ -129,8 +133,7 @@ Fix the error in your code and re-run your tests.
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ✖ browserify_babel_es2015_failing_spe XX:XX - - 1 - - │
│ c.js │
│ ✖ es_module_import_failing_spec.js XX:XX - - 1 - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
✖ 1 of 1 failed (100%) XX:XX - - 1 - -
Expand Down
Loading

0 comments on commit 474bcdd

Please sign in to comment.