2024-10-01 22:41:10 -07:00
|
|
|
// @ts-check
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
// eslint-disable-next-line n/no-extraneous-require
|
|
|
|
const test = require("ava").default;
|
|
|
|
const { "exports": packageExports, name } = require("../helpers/package.json");
|
|
|
|
|
|
|
|
const exportMappings = new Map([
|
2024-11-28 20:36:44 -08:00
|
|
|
[ ".", "../helpers/helpers.cjs" ],
|
2024-10-01 22:41:10 -07:00
|
|
|
[ "./micromark", "../helpers/micromark-helpers.cjs" ]
|
|
|
|
]);
|
|
|
|
|
|
|
|
test("exportMappings", (t) => {
|
|
|
|
t.deepEqual(
|
|
|
|
Object.keys(packageExports),
|
|
|
|
[ ...exportMappings.keys() ]
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
for (const [ exportName, exportPath ] of exportMappings) {
|
|
|
|
test(exportName, (t) => {
|
|
|
|
t.is(
|
|
|
|
require(exportName.replace(/^\./u, name)),
|
|
|
|
require(exportPath)
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|