Skip to content

Commit

Permalink
chore: re-add native module test that used to be flaky (#7631)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaietta authored Jun 27, 2023
1 parent c569e44 commit 8442676
Show file tree
Hide file tree
Showing 5 changed files with 145 additions and 15 deletions.
5 changes: 5 additions & 0 deletions .changeset/empty-cups-marry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

---

chore: re-add native module test that used to be flaky
3 changes: 3 additions & 0 deletions test/fixtures/test-app-two-native-modules/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"version": "1.1.1",
"dependencies": {
"debug": "4.1.1"
},
"optionalDependencies": {
"node-mac-permissions": "2.3.0"
}
}
40 changes: 36 additions & 4 deletions test/fixtures/test-app-two-native-modules/app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,39 @@
# yarn lockfile v1


install@0.13.0:
version "0.13.0"
resolved "https://registry.yarnpkg.com/install/-/install-0.13.0.tgz#6af6e9da9dd0987de2ab420f78e60d9c17260776"
integrity sha512-zDml/jzr2PKU9I8J/xyZBQn8rPCAY//UOYNmR01XwNwyfhEWObo2SWfSl1+0tm1u6PhxLwDnfsT/6jB7OUxqFA==
bindings@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df"
integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==
dependencies:
file-uri-to-path "1.0.0"

debug@4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
dependencies:
ms "^2.1.1"

file-uri-to-path@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==

ms@^2.1.1:
version "2.1.3"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==

node-addon-api@^3.0.2:
version "3.2.1"
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-3.2.1.tgz#81325e0a2117789c0128dab65e7e38f07ceba161"
integrity sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==

node-mac-permissions@2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/node-mac-permissions/-/node-mac-permissions-2.3.0.tgz#17b2d9b8c155b6abd43cce51fedc19d34537a333"
integrity sha512-kZ/bUeXv+Xp6+VLS77ShgSfS8df9HB13SnS1ql+d3Cd5ry0uZkOgNh434cAhZBHiagYQWykPqgY7n9jd7t74Fw==
dependencies:
bindings "^1.5.0"
node-addon-api "^3.0.2"
22 changes: 11 additions & 11 deletions test/snapshots/HoistedNodeModuleTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -188,37 +188,37 @@ Object {
"debug": Object {
"files": Object {
"LICENSE": Object {
"offset": "3476",
"offset": "3545",
"size": 1107,
},
"dist": Object {
"files": Object {
"debug.js": Object {
"offset": "22080",
"offset": "22149",
"size": 27572,
},
},
},
"package.json": Object {
"offset": "4583",
"offset": "4652",
"size": 947,
},
"src": Object {
"files": Object {
"browser.js": Object {
"offset": "5530",
"offset": "5599",
"size": 5831,
},
"common.js": Object {
"offset": "11361",
"offset": "11430",
"size": 5930,
},
"index.js": Object {
"offset": "17291",
"offset": "17360",
"size": 314,
},
"node.js": Object {
"offset": "17605",
"offset": "17674",
"size": 4475,
},
},
Expand All @@ -228,15 +228,15 @@ Object {
"ms": Object {
"files": Object {
"index.js": Object {
"offset": "49652",
"offset": "49721",
"size": 3024,
},
"license.md": Object {
"offset": "52676",
"offset": "52745",
"size": 1079,
},
"package.json": Object {
"offset": "53755",
"offset": "53824",
"size": 497,
},
},
Expand All @@ -245,7 +245,7 @@ Object {
},
"package.json": Object {
"offset": "3342",
"size": 134,
"size": 203,
},
},
}
Expand Down
90 changes: 90 additions & 0 deletions test/snapshots/mac/macPackagerTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,50 @@ Object {
},
},
},
"node-mac-permissions": Object {
"files": Object {
".prettierrc": Object {
"size": "<size>",
"unpacked": true,
},
"LICENSE": Object {
"size": "<size>",
"unpacked": true,
},
"build": Object {
"files": Object {
"Release": Object {
"files": Object {
"permissions.node": Object {
"size": "<size>",
"unpacked": true,
},
},
},
"node_gyp_bins": Object {
"files": Object {
"python3": Object {
"size": "<size>",
"unpacked": true,
},
},
},
},
},
"index.js": Object {
"size": "<size>",
"unpacked": true,
},
"package.json": Object {
"size": "<size>",
"unpacked": true,
},
"permissions.mm": Object {
"size": "<size>",
"unpacked": true,
},
},
},
},
},
"package.json": Object {
Expand All @@ -540,5 +584,51 @@ exports[`yarn two package.json w/ native module 4`] = `
Array [
"app.asar",
"electron.icns",
"app.asar.unpacked/node_modules/node-mac-permissions/LICENSE",
"app.asar.unpacked/node_modules/node-mac-permissions/index.js",
Object {
"content": "{
\\"name\\": \\"node-mac-permissions\\",
\\"version\\": \\"2.3.0\\",
\\"description\\": \\"A native node module to manage system permissions on macOS\\",
\\"main\\": \\"index.js\\",
\\"types\\": \\"index.d.ts\\",
\\"repository\\": {
\\"type\\": \\"git\\",
\\"url\\": \\"git+https://github.com/codebytere/node-mac-permissions.git\\"
},
\\"author\\": \\"Shelley Vohr <shelley.vohr@gmail.com>\\",
\\"license\\": \\"MIT\\",
\\"homepage\\": \\"https://github.com/codebytere/node-mac-permissions#readme\\",
\\"dependencies\\": {
\\"bindings\\": \\"^1.5.0\\",
\\"node-addon-api\\": \\"^3.0.2\\"
},
\\"devDependencies\\": {
\\"chai\\": \\"^4.3.6\\",
\\"clang-format\\": \\"1.8.0\\",
\\"husky\\": \\"^8.0.1\\",
\\"lint-staged\\": \\"^12.4.1\\",
\\"mocha\\": \\"^10.0.0\\",
\\"node-gyp\\": \\"^9.0.0\\",
\\"prettier\\": \\"^2.6.2\\"
},
\\"lint-staged\\": {
\\"*.js\\": [
\\"prettier --write\\"
],
\\"*.mm\\": [
\\"clang-format -i\\"
]
},
\\"os\\": [
\\"darwin\\"
]
}",
"name": "app.asar.unpacked/node_modules/node-mac-permissions/package.json",
},
"app.asar.unpacked/node_modules/node-mac-permissions/permissions.mm",
"app.asar.unpacked/node_modules/node-mac-permissions/build/node_gyp_bins/python3",
"app.asar.unpacked/node_modules/node-mac-permissions/build/Release/permissions.node",
]
`;

0 comments on commit 8442676

Please sign in to comment.