/
githubmirror
/
babel
Обзор
Документация
Войти
/
githubmirror
/
babel
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/babel-plugin-transform-modules-systemjs/test/systemjs-exec.test.js
29 строк
718 B
Huáng Jùnliàng
Add file URL support for test runners (#18002)
16 май 2026, 04:24
Не верифицирован
16 май 2026, 04:24
0b91d35
Код
Авторство
О чём код?
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"); }); });