mirror of
https://github.com/morluto/rea.git
synced 2026-11-13 05:01:45 -10:00
fix(electron): retain unknown external module ownership (#7950)
This commit is contained in:
1 parent
3536ea2f49
commit
59a895a193
4 files changed
+77
-5
No files matched your search
@@ -4494,3 +4494,28 @@ describe("package metadata at archive module boundaries", () => {
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it("distinguishes an unobserved bare package from builtins and blocked aliases", () => {
|
||||
const files = aliasFiles({
|
||||
"package.json": JSON.stringify({
|
||||
imports: { "#blocked": null, "#builtin": "node:path" },
|
||||
}),
|
||||
"main.js": "",
|
||||
});
|
||||
const resolveName = (declaredPath: string) =>
|
||||
resolve({
|
||||
declaredPath,
|
||||
sourcePath: "main.js",
|
||||
context: "module-specifier",
|
||||
moduleKind: "require",
|
||||
files,
|
||||
});
|
||||
expect(resolveName("outside-package")).toMatchObject({
|
||||
resolution_status: "external",
|
||||
unexamined_module_imports: true,
|
||||
});
|
||||
for (const name of ["node:path", "electron", "#blocked", "#builtin"])
|
||||
expect(resolveName(name), name).not.toHaveProperty(
|
||||
"unexamined_module_imports",
|
||||
);
|
||||
});
|
||||
Reference in new issue
Block a user