-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix e2e vue-cli
Babel 8 tests
#13050
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ee6d7f1
Fix e2e `vue-cli` Babel 8 tests
nicolo-ribaudo c59c73d
Maybe this works
nicolo-ribaudo fc01e8e
Update e2e-vue-cli.sh
hzoo 013c3d9
Try again
nicolo-ribaudo 8b61580
This?
nicolo-ribaudo 5acc48b
Make the deps tests pass
nicolo-ribaudo 276d3b9
Reduce patch
nicolo-ribaudo File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
diff --git a/packages/@vue/babel-preset-app/__tests__/babel-preset.spec.js b/packages/@vue/babel-preset-app/__tests__/babel-preset.spec.js | ||
index d57f42b..60c938a 100644 | ||
--- a/packages/@vue/babel-preset-app/__tests__/babel-preset.spec.js | ||
+++ b/packages/@vue/babel-preset-app/__tests__/babel-preset.spec.js | ||
@@ -3,7 +3,7 @@ const babel = require('@babel/core') | ||
const preset = require('../index') | ||
const defaultOptions = { | ||
babelrc: false, | ||
- presets: [preset], | ||
+ presets: [[preset, { targets: { ie: 9 } }]], | ||
filename: 'test-entry-file.js' | ||
} | ||
|
||
@@ -161,6 +161,7 @@ test('disable absoluteRuntime', () => { | ||
`.trim(), { | ||
babelrc: false, | ||
presets: [[preset, { | ||
+ targets: { ie: 9 }, | ||
absoluteRuntime: false | ||
}]], | ||
filename: 'test-entry-file.js' | ||
@@ -183,6 +184,7 @@ test('should inject polyfills / helpers using "require" statements for a umd mod | ||
`.trim(), { | ||
babelrc: false, | ||
presets: [[preset, { | ||
+ targets: { ie: 9 }, | ||
absoluteRuntime: false | ||
}]], | ||
filename: 'test-entry-file.js' | ||
@@ -200,6 +202,7 @@ test('should inject polyfills / helpers using "import" statements for an es modu | ||
`.trim(), { | ||
babelrc: false, | ||
presets: [[preset, { | ||
+ targets: { ie: 9 }, | ||
absoluteRuntime: false | ||
}]], | ||
filename: 'test-entry-file.js' | ||
@@ -216,6 +219,7 @@ test('should not inject excluded polyfills', () => { | ||
`.trim(), { | ||
babelrc: false, | ||
presets: [[preset, { | ||
+ targets: { ie: 9 }, | ||
exclude: ['es.promise'], | ||
polyfills: ['es.array.iterator', 'es.object.assign'] | ||
}]], | ||
diff --git a/packages/@vue/cli-plugin-babel/__tests__/transpileDependencies.spec.js b/packages/@vue/cli-plugin-babel/__tests__/transpileDependencies.spec.js | ||
index 1c5d6c2..6f90582 100644 | ||
--- a/packages/@vue/cli-plugin-babel/__tests__/transpileDependencies.spec.js | ||
+++ b/packages/@vue/cli-plugin-babel/__tests__/transpileDependencies.spec.js | ||
@@ -78,6 +78,14 @@ test('dep from node_modules should been transpiled when matched by transpileDepe | ||
'vue.config.js', | ||
`module.exports = { transpileDependencies: ['external-dep', '@scope/external-dep'] }` | ||
) | ||
+ await project.write( | ||
+ 'babel.config.js', | ||
+ `module.exports = { | ||
+ presets: [ | ||
+ ["@vue/babel-preset-app", { targets: { ie: 9 } }] | ||
+ ] | ||
+ }` | ||
+ ) | ||
await project.run('vue-cli-service build') | ||
expect(await readVendorFile()).toMatch('return "__TEST__"') | ||
|
||
@@ -89,6 +97,14 @@ test('dep from node_modules should been transpiled when transpileDependencies is | ||
'vue.config.js', | ||
`module.exports = { transpileDependencies: true }` | ||
) | ||
+ await project.write( | ||
+ 'babel.config.js', | ||
+ `module.exports = { | ||
+ presets: [ | ||
+ ["@vue/babel-preset-app", { targets: { ie: 9 } }] | ||
+ ] | ||
+ }` | ||
+ ) | ||
await project.run('vue-cli-service build') | ||
expect(await readVendorFile()).toMatch('return "__TEST__"') | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ended up doing a patch, it feels less hacky than a regexp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds good, noticed vue-cli had one too!