Specify runtime exports (#10853)

This commit is contained in:
Huáng Jùnliàng
2020-10-14 14:06:56 -04:00
committed by GitHub
parent 21d7ee2610
commit 4e66b8eb6b
20 changed files with 1138 additions and 52 deletions

View File

@@ -0,0 +1,34 @@
import assert from "assert";
export default {
title: "@babel/runtime",
testcases: [
[
"it should throw on unknown helpers",
() =>
assert.rejects(
async () => import("@babel/runtime/helpers/esm/unknown-helper"),
{
name: "Error",
code: "ERR_MODULE_NOT_FOUND",
}
),
],
[
"it supports importing with explicit extension",
() =>
assert.doesNotReject(
async () => import("@babel/runtime/helpers/esm/wrapNativeSuper.js"),
Error
),
],
[
"it should not throw on helpers importing internal helpers",
() =>
assert.doesNotReject(
async () => import("@babel/runtime/helpers/esm/wrapNativeSuper"),
Error
),
],
],
};