Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add test case for asarUnpack in yarn workspaces #8584

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test/fixtures/test-app-yarn-several-workspace/package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "example",
"private": true,
"workspaces": [
"packages/*"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
foo: () => "bar"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
34 changes: 21 additions & 13 deletions test/snapshots/HoistedNodeModuleTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -162,32 +162,36 @@ Object {
},
"foo": Object {
"files": Object {
"package.json": Object {
"index.js": Object {
"offset": "14750",
"size": 39,
},
"package.json": Object {
"offset": "14789",
"size": 127,
},
},
},
"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,
},
},
},
},
},
"package.json": Object {
"offset": "22529",
"offset": "22629",
"size": 326,
},
},
Expand All @@ -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 {
Expand Down Expand Up @@ -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,
},
},
Expand All @@ -308,7 +316,7 @@ Object {
},
},
"package.json": Object {
"offset": "18219",
"offset": "18319",
"size": 326,
},
},
Expand Down
3 changes: 3 additions & 0 deletions test/src/HoistedNodeModuleTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down
Loading