test: explicitly add ie 11 to targets in tests

As the default target of browerslist now changes, the tests can no
longer reflect their original intentions unless explicitly targeting
IE 11.
This commit is contained in:
Haoqun Jiang
2022-06-27 21:58:22 +08:00
parent c7fa1cfd22
commit 434c72c140
@@ -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'
}
@@ -161,7 +165,8 @@ test('disable absoluteRuntime', () => {
`.trim(), {
babelrc: false,
presets: [[preset, {
absoluteRuntime: false
absoluteRuntime: false,
targets: { ie: '11' }
}]],
filename: 'test-entry-file.js'
})
@@ -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'
})
@@ -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'
})
@@ -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'
})