Skip to content

Commit 4c0cf19

Browse files
committed
Conditionally load polyfills required for testing
1 parent b94b20b commit 4c0cf19

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"@babel/core": "^7.4.4",
2424
"@babel/preset-env": "^7.4.4",
2525
"airtap": "^2.0.2",
26+
"core-js": "^3.0.1",
2627
"cross-env": "^5.2.0",
2728
"object.getownpropertydescriptors": "^2.0.3",
2829
"tape": "^4.10.1"

test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
const test = require('tape');
22

3+
// Conditionally load polyfills required for testing
4+
if (typeof Promise === 'undefined') {
5+
console.log('Loading Promise polyfill');
6+
require('core-js/features/promise');
7+
}
8+
39
const testPaths = [
410
['test-assert-async.js', () => require('./test/parallel/test-assert-async.js')],
511
['test-assert-checktag.js', () => require('./test/parallel/test-assert-checktag.js')],

0 commit comments

Comments
 (0)