Skip to content

Commit

Permalink
test: explicitly add ie 11 to targets in tests
Browse files Browse the repository at this point in the history
As the default target of browerslist now changes, the tests can no
longer reflect their original intentions unless explicitly targeting
IE 11.
  • Loading branch information
haoqunjiang committed Jun 27, 2022
1 parent c7fa1cf commit 434c72c
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions packages/@vue/babel-preset-app/__tests__/babel-preset.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ const babel = require('@babel/core')
const preset = require('../index')
const defaultOptions = {
babelrc: false,
presets: [preset],
presets: [[preset, {
targets: {
ie: '11'
}
}]],
filename: 'test-entry-file.js'
}

Expand Down Expand Up @@ -161,7 +165,8 @@ test('disable absoluteRuntime', () => {
`.trim(), {
babelrc: false,
presets: [[preset, {
absoluteRuntime: false
absoluteRuntime: false,
targets: { ie: '11' }
}]],
filename: 'test-entry-file.js'
})
Expand All @@ -183,7 +188,8 @@ test('should inject polyfills / helpers using "require" statements for a umd mod
`.trim(), {
babelrc: false,
presets: [[preset, {
absoluteRuntime: false
absoluteRuntime: false,
targets: { ie: '11' }
}]],
filename: 'test-entry-file.js'
})
Expand All @@ -200,7 +206,8 @@ test('should inject polyfills / helpers using "import" statements for an es modu
`.trim(), {
babelrc: false,
presets: [[preset, {
absoluteRuntime: false
absoluteRuntime: false,
targets: { ie: '11' }
}]],
filename: 'test-entry-file.js'
})
Expand All @@ -217,7 +224,8 @@ test('should not inject excluded polyfills', () => {
babelrc: false,
presets: [[preset, {
exclude: ['es.promise'],
polyfills: ['es.array.iterator', 'es.object.assign']
polyfills: ['es.array.iterator', 'es.object.assign'],
targets: { ie: '11' }
}]],
filename: 'test-entry-file.js'
})
Expand Down

0 comments on commit 434c72c

Please sign in to comment.