Use native ESM for dev scripts (#12296)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
34
test/esm/babel-runtime.js
Normal file
34
test/esm/babel-runtime.js
Normal 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
|
||||
),
|
||||
],
|
||||
],
|
||||
};
|
||||
Reference in New Issue
Block a user