Skip to content

Commit 474bcdd

Browse files
feat: Change default preprocessor to webpack (#7982)
* 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 <brian.mann86@gmail.com>
1 parent 6c15dde commit 474bcdd

32 files changed

+518
-656
lines changed

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ packages/server/lib/scaffold/plugins/index.js
2626
packages/server/lib/scaffold/support/index.js
2727
packages/server/lib/scaffold/support/commands.js
2828
packages/server/test/support/fixtures/projects/e2e/cypress/integration/stdout_exit_early_failing_spec.js
29-
packages/server/test/support/fixtures/projects/e2e/cypress/integration/browserify_typescript_failing_spec.ts
29+
packages/server/test/support/fixtures/projects/e2e/cypress/integration/typescript_failing_spec.ts
3030

3131
**/.projects
3232
**/*.d.ts

packages/server/__snapshots__/1_busted_support_file_spec.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,18 @@ Oops...we found an error preparing this test file:
2121
2222
The error was:
2323
24-
Error: Cannot find module './does/not/exist' from '/foo/bar/.projects/busted-support-file/cypress/support'
24+
Error: Webpack Compilation Error
25+
./cypress/support/index.js
26+
Module not found: Error: Can't resolve './does/not/exist' in '/foo/bar/.projects/busted-support-file/cypress/support'
27+
Looked for and couldn't find the file at the following paths:
28+
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist]
29+
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.js]
30+
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.json]
31+
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.jsx]
32+
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.coffee]
33+
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.ts]
34+
[/foo/bar/.projects/busted-support-file/cypress/support/does/not/exist.tsx]
35+
@ ./cypress/support/index.js 3:0-27
2536
2637
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
2738

packages/server/__snapshots__/1_browserify_babel_es201_spec.js renamed to packages/server/__snapshots__/1_es_modules_spec.js

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
exports['e2e browserify, babel, es2015 passes 1'] = `
1+
exports['e2e es modules passes 1'] = `
22
33
====================================================================================================
44
@@ -7,14 +7,14 @@ exports['e2e browserify, babel, es2015 passes 1'] = `
77
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
88
│ Cypress: 1.2.3 │
99
│ Browser: FooBrowser 88 │
10-
│ Specs: 1 found (browserify_babel_es2015_passing_spec.coffee) │
11-
│ Searched: cypress/integration/browserify_babel_es2015_passing_spec.coffee │
10+
│ Specs: 1 found (es_modules_in_coffee_spec.coffee)
11+
│ Searched: cypress/integration/es_modules_in_coffee_spec.coffee
1212
└────────────────────────────────────────────────────────────────────────────────────────────────┘
1313
1414
1515
────────────────────────────────────────────────────────────────────────────────────────────────────
1616
17-
Running: browserify_babel_es2015_passing_spec.coffee (1 of 1)
17+
Running: es_modules_in_coffee_spec.coffee (1 of 1)
1818
1919
2020
imports work
@@ -37,15 +37,15 @@ exports['e2e browserify, babel, es2015 passes 1'] = `
3737
│ Screenshots: 0 │
3838
│ Video: true │
3939
│ Duration: X seconds │
40-
│ Spec Ran: browserify_babel_es2015_passing_spec.coffee │
40+
│ Spec Ran: es_modules_in_coffee_spec.coffee
4141
└────────────────────────────────────────────────────────────────────────────────────────────────┘
4242
4343
4444
(Video)
4545
4646
- Started processing: Compressing to 32 CRF
47-
- Finished processing: /XXX/XXX/XXX/cypress/videos/browserify_babel_es2015_passing (X second)
48-
_spec.coffee.mp4
47+
- Finished processing: /XXX/XXX/XXX/cypress/videos/es_modules_in_coffee_spec.coffe (X second)
48+
e.mp4
4949
5050
5151
====================================================================================================
@@ -55,15 +55,14 @@ exports['e2e browserify, babel, es2015 passes 1'] = `
5555
5656
Spec Tests Passing Failing Pending Skipped
5757
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
58-
│ ✔ browserify_babel_es2015_passing_spe XX:XX 3 3 - - - │
59-
│ c.coffee │
58+
│ ✔ es_modules_in_coffee_spec.coffee XX:XX 3 3 - - - │
6059
└────────────────────────────────────────────────────────────────────────────────────────────────┘
6160
✔ All specs passed! XX:XX 3 3 - - -
6261
6362
6463
`
6564

66-
exports['e2e browserify, babel, es2015 fails 1'] = `
65+
exports['e2e es modules fails 1'] = `
6766
6867
====================================================================================================
6968
@@ -72,26 +71,31 @@ exports['e2e browserify, babel, es2015 fails 1'] = `
7271
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
7372
│ Cypress: 1.2.3 │
7473
│ Browser: FooBrowser 88 │
75-
│ Specs: 1 found (browserify_babel_es2015_failing_spec.js) │
76-
│ Searched: cypress/integration/browserify_babel_es2015_failing_spec.js │
74+
│ Specs: 1 found (es_module_import_failing_spec.js)
75+
│ Searched: cypress/integration/es_module_import_failing_spec.js
7776
└────────────────────────────────────────────────────────────────────────────────────────────────┘
7877
7978
8079
────────────────────────────────────────────────────────────────────────────────────────────────────
8180
82-
Running: browserify_babel_es2015_failing_spec.js (1 of 1)
81+
Running: es_module_import_failing_spec.js (1 of 1)
8382
8483
Oops...we found an error preparing this test file:
8584
86-
/foo/bar/.projects/e2e/cypress/integration/browserify_babel_es2015_failing_spec.js
85+
/foo/bar/.projects/e2e/cypress/integration/es_module_import_failing_spec.js
8786
8887
The error was:
8988
89+
Error: Webpack Compilation Error
90+
./lib/fail.js
91+
Module build failed (from [..]):
9092
SyntaxError: /foo/bar/.projects/e2e/lib/fail.js: Unexpected token (2:0)
9193
9294
1 | export default {
9395
> 2 |
94-
| ^ while parsing file: /foo/bar/.projects/e2e/lib/fail.js
96+
| ^
97+
98+
@ ./cypress/integration/es_module_import_failing_spec.js 3:0-25
9599
96100
This occurred while Cypress was compiling and bundling your test code. This is usually caused by:
97101
@@ -111,15 +115,15 @@ Fix the error in your code and re-run your tests.
111115
│ Screenshots: 0 │
112116
│ Video: true │
113117
│ Duration: X seconds │
114-
│ Spec Ran: browserify_babel_es2015_failing_spec.js │
118+
│ Spec Ran: es_module_import_failing_spec.js
115119
└────────────────────────────────────────────────────────────────────────────────────────────────┘
116120
117121
118122
(Video)
119123
120124
- Started processing: Compressing to 32 CRF
121-
- Finished processing: /XXX/XXX/XXX/cypress/videos/browserify_babel_es2015_failing (X second)
122-
_spec.js.mp4
125+
- Finished processing: /XXX/XXX/XXX/cypress/videos/es_module_import_failing_spec.j (X second)
126+
s.mp4
123127
124128
125129
====================================================================================================
@@ -129,8 +133,7 @@ Fix the error in your code and re-run your tests.
129133
130134
Spec Tests Passing Failing Pending Skipped
131135
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
132-
│ ✖ browserify_babel_es2015_failing_spe XX:XX - - 1 - - │
133-
│ c.js │
136+
│ ✖ es_module_import_failing_spec.js XX:XX - - 1 - - │
134137
└────────────────────────────────────────────────────────────────────────────────────────────────┘
135138
✖ 1 of 1 failed (100%) XX:XX - - 1 - -
136139

0 commit comments

Comments
 (0)