mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 17:44:27 +00:00
fix(javascript): prove native URL constructor paths
This commit is contained in:
1 parent
f97747c2fb
commit
55437c1431
4 files changed
+28
-6
No files matched your search
@@ -21,6 +21,21 @@ it.each([
|
||||
},
|
||||
);
|
||||
|
||||
it.each([
|
||||
["", "./native.js"],
|
||||
["url.URL = class {};", null],
|
||||
] as const)(
|
||||
"requires the native URL constructor identity after %s",
|
||||
(write, expected) => {
|
||||
const analysis = analyzeJavaScriptStaticSource(`${windowPrefix}
|
||||
import url from 'node:url';${write}
|
||||
new BrowserWindow({webPreferences:{preload:fileURLToPath(new (url.URL as typeof URL)("./native.js", import.meta.url))}});`);
|
||||
expect(analysis.electron.browser_windows).toMatchObject([
|
||||
{ preload_path: expected },
|
||||
]);
|
||||
},
|
||||
);
|
||||
|
||||
it.each([
|
||||
'["a", "b"].join("/")',
|
||||
'settings.join("/app", "preload.js")',
|
||||
|
||||
Reference in new issue
Block a user