diff --git a/test/fixtures/test-app-yarn-several-workspace/package.json b/test/fixtures/test-app-yarn-several-workspace/package.json index 8de1b8ebd98..905e6bce6a1 100644 --- a/test/fixtures/test-app-yarn-several-workspace/package.json +++ b/test/fixtures/test-app-yarn-several-workspace/package.json @@ -1,4 +1,5 @@ { + "name": "example", "private": true, "workspaces": [ "packages/*" diff --git a/test/fixtures/test-app-yarn-several-workspace/packages/foo/index.js b/test/fixtures/test-app-yarn-several-workspace/packages/foo/index.js new file mode 100644 index 00000000000..813ed764a85 --- /dev/null +++ b/test/fixtures/test-app-yarn-several-workspace/packages/foo/index.js @@ -0,0 +1,3 @@ +module.exports = { + foo: () => "bar" +} \ No newline at end of file diff --git a/test/fixtures/test-app-yarn-several-workspace/packages/test-app/index.js b/test/fixtures/test-app-yarn-several-workspace/packages/test-app/index.js index c7e706aa9db..0b7e7073968 100644 --- a/test/fixtures/test-app-yarn-several-workspace/packages/test-app/index.js +++ b/test/fixtures/test-app-yarn-several-workspace/packages/test-app/index.js @@ -3,6 +3,9 @@ const { app, ipcMain, BrowserWindow, Menu, Tray } = require("electron") const fs = require("fs") const path = require("path") +const foo = require("@example/foo") + +console.log(foo.bar()); // Module to control application life. // Module to create native browser window. diff --git a/test/snapshots/HoistedNodeModuleTest.js.snap b/test/snapshots/HoistedNodeModuleTest.js.snap index 5623be21494..7efa838a745 100644 --- a/test/snapshots/HoistedNodeModuleTest.js.snap +++ b/test/snapshots/HoistedNodeModuleTest.js.snap @@ -83,12 +83,12 @@ exports[`yarn several workspaces 2`] = ` Object { "files": Object { "index.html": Object { - "offset": "19187", + "offset": "19226", "size": 841, }, "index.js": Object { - "offset": "20028", - "size": 2501, + "offset": "20067", + "size": 2562, }, "node_modules": Object { "files": Object { @@ -162,8 +162,12 @@ Object { }, "foo": Object { "files": Object { - "package.json": Object { + "index.js": Object { "offset": "14750", + "size": 39, + }, + "package.json": Object { + "offset": "14789", "size": 127, }, }, @@ -171,15 +175,15 @@ Object { "ms": Object { "files": Object { "index.js": Object { - "offset": "14877", + "offset": "14916", "size": 2764, }, "license.md": Object { - "offset": "17641", + "offset": "17680", "size": 1077, }, "package.json": Object { - "offset": "18718", + "offset": "18757", "size": 469, }, }, @@ -187,7 +191,7 @@ Object { }, }, "package.json": Object { - "offset": "22529", + "offset": "22629", "size": 326, }, }, @@ -204,12 +208,12 @@ exports[`yarn several workspaces and asarUnpack 2`] = ` Object { "files": Object { "index.html": Object { - "offset": "14877", + "offset": "14916", "size": 841, }, "index.js": Object { - "offset": "15718", - "size": 2501, + "offset": "15757", + "size": 2562, }, "node_modules": Object { "files": Object { @@ -283,8 +287,12 @@ Object { }, "foo": Object { "files": Object { - "package.json": Object { + "index.js": Object { "offset": "14750", + "size": 39, + }, + "package.json": Object { + "offset": "14789", "size": 127, }, }, @@ -308,7 +316,7 @@ Object { }, }, "package.json": Object { - "offset": "18219", + "offset": "18319", "size": 326, }, }, diff --git a/test/src/HoistedNodeModuleTest.ts b/test/src/HoistedNodeModuleTest.ts index c5f5807148f..07e37f0a1d9 100644 --- a/test/src/HoistedNodeModuleTest.ts +++ b/test/src/HoistedNodeModuleTest.ts @@ -33,6 +33,9 @@ test.ifAll("yarn several workspaces", () => { targets: linuxDirTarget, projectDir: "packages/test-app", + config: { + asarUnpack: ["**/node_modules/ms"] + } }, { packed: context => verifyAsarFileTree(context.getResources(Platform.LINUX)),