mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
* test: accept URL in fixture test runner * test: use URL for fixture calls * test: extract systemjs-exec test into single file
30 lines
718 B
JavaScript
30 lines
718 B
JavaScript
import { readFileSync } from "node:fs";
|
|
import {
|
|
runCodeInTestContext,
|
|
createTestContext,
|
|
} from "@babel/helper-transform-fixture-test-runner";
|
|
|
|
describe("systemjs exec", function () {
|
|
// https://github.com/babel/babel/issues/16219
|
|
it("should requeue helpers", function () {
|
|
const filename = new URL(
|
|
"./fixtures/preset-env/requeue-helpers/output.js",
|
|
import.meta.url,
|
|
);
|
|
const content = readFileSync(filename, "utf8");
|
|
|
|
let res;
|
|
|
|
const context = createTestContext();
|
|
context.System = {
|
|
register: function (_, module) {
|
|
res = module().execute();
|
|
},
|
|
};
|
|
|
|
runCodeInTestContext(content, { filename }, context);
|
|
|
|
expect(res).toBe("ok");
|
|
});
|
|
});
|