mirror of
https://github.com/morluto/rea.git
synced 2026-11-08 07:46:28 +00:00
test(javascript): preserve fixture runtime context for path analysis
This commit is contained in:
1 parent
54a663ddd5
commit
c3ad8fc024
8 files changed
+132
-97
No files matched your search
@@ -205,16 +205,17 @@ describe("Electron option evidence", () => {
|
||||
},
|
||||
);
|
||||
|
||||
it("does not read an audio or video preload attribute as a preload script", () => {
|
||||
it("selects proven Electron preloads while ignoring media attributes and unrelated properties", () => {
|
||||
const analysis = analyzeJavaScriptStaticSource(`
|
||||
jsx("audio", { controls: true, preload: "metadata", src });
|
||||
(0, React.createElement)(\`video\`, { preload: "auto" });
|
||||
jsx("webview", { preload: "./guest.js" });
|
||||
const options = { preload: "./preload.js" };
|
||||
const options = { preload: "./unrelated.js" };
|
||||
const { BrowserWindow } = require("electron");
|
||||
new BrowserWindow({webPreferences: {preload: "./preload.js"}});
|
||||
`);
|
||||
|
||||
expect(analysis.role_paths.map(({ path }) => path)).toEqual([
|
||||
"./guest.js",
|
||||
"./preload.js",
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user