| 1 |
import assert from "assert"; |
| 2 |
|
| 3 |
export default { |
| 4 |
title: "@babel/runtime-corejs3", |
| 5 |
testcases: [ |
| 6 |
[ |
| 7 |
"it should throw on unknown helpers", |
| 8 |
() => |
| 9 |
assert.rejects( |
| 10 |
async () => |
| 11 |
import("@babel/runtime-corejs3/helpers/esm/unknown-helper"), |
| 12 |
{ |
| 13 |
name: "Error", |
| 14 |
code: "ERR_PACKAGE_PATH_NOT_EXPORTED", |
| 15 |
} |
| 16 |
), |
| 17 |
], |
| 18 |
[ |
| 19 |
"it should not throw on helpers importing internal helpers", |
| 20 |
() => |
| 21 |
assert.doesNotReject( |
| 22 |
async () => |
| 23 |
import("@babel/runtime-corejs3/helpers/esm/wrapNativeSuper"), |
| 24 |
Error |
| 25 |
), |
| 26 |
], |
| 27 |
/*[ |
| 28 |
"it supports importing with explicit extension", |
| 29 |
() => |
| 30 |
assert.doesNotReject( |
| 31 |
async () => import("@babel/runtime/helpers/esm/wrapNativeSuper.js"), |
| 32 |
Error |
| 33 |
), |
| 34 |
],*/ |
| 35 |
[ |
| 36 |
"it should not throw on importing core-js helpers", |
| 37 |
() => |
| 38 |
assert.doesNotReject( |
| 39 |
async () => import("@babel/runtime-corejs3/core-js/array/is-array"), |
| 40 |
Error |
| 41 |
), |
| 42 |
], |
| 43 |
/*[ |
| 44 |
"it should not throw on importing core-js helpers with explicit extension", |
| 45 |
() => |
| 46 |
assert.doesNotReject( |
| 47 |
async () => |
| 48 |
import("@babel/runtime-corejs3/core-js/array/is-array.js"), |
| 49 |
Error |
| 50 |
), |
| 51 |
],*/ |
| 52 |
[ |
| 53 |
"it should not throw on importing regenerator helpers", |
| 54 |
() => |
| 55 |
assert.doesNotReject( |
| 56 |
async () => import("@babel/runtime-corejs3/regenerator"), |
| 57 |
Error |
| 58 |
), |
| 59 |
], |
| 60 |
[ |
| 61 |
"it should not throw on importing regenerator helpers with explicit extension", |
| 62 |
() => |
| 63 |
assert.doesNotReject( |
| 64 |
async () => import("@babel/runtime-corejs3/regenerator/index.js"), |
| 65 |
Error |
| 66 |
), |
| 67 |
], |
| 68 |
], |
| 69 |
}; |