9 Commits

Author SHA1 Message Date
Mike Maietta
64be29d2f7 fix: Skip lipo if native module is already universal. Add native module fixtures for lipo tests (#126)
* fix: when native modules are already universal, don't lipo. adds `node-mac-permissions` fixture from https://github.com/codebytere/node-mac-permissions and resolves 3 `it.todo` test cases

* add test `different app dirs with different macho files (shim and lipo)`

* add additional test

* PR feedback

* gotta close `fd`

* use `stream` to read first 4 bytes. copy native fixture before packing into asar to leverage `unpack: "**/*.node"` properly.

* convert params to object

* rename `createTestApp` to `createStagingAppDir` and add jsdoc to the function

* compiler error from merge conflict

* update snapshots

* update snapshots

* only check x64Content since it's the tmp app

* compile macho binaries at runtime using hellow-world.c for fixtures in lipo tests

* Update jest.setup.ts

Co-authored-by: Erik Moura <erikian@erikian.dev>

* Update jest.setup.ts

Co-authored-by: Erik Moura <erikian@erikian.dev>

* remove unstable properties for specific keys

* force redo

* update snapshots

* stripping only hello-world from snapshot and only hash from macho-specific asar integrity

* optimize logic :)

---------

Co-authored-by: Erik Moura <erikian@erikian.dev>
2025-05-02 13:10:36 -03:00
Erik Moura
977baa4d42 test: add explicit imports for jest functions (#128)
* test: add explicit imports for `jest` functions

* add workaround for non-`.spec.ts` file
2025-03-31 23:17:05 -07:00
Mike Maietta
2b67c905a6 fix: Allow EnableEmbeddedAsarIntegrityValidation when multiple asars are present in app (#124)
- When an application uses multiple asars (`webapp.asar`, `anything.asar`, etc.), `EnableEmbeddedAsarIntegrityValidation` fuse breaks the application due to not all asars having integrity generated for them. Fixes: #116
- **Also fixes bug** to correctly test `makeUniversalApp no asar mode should shim two different app folders`, (it was not having an asar integrity generated for the shimmed asar)

Functionality added:
- Moves all asar integrity generation to **after** all app assets have been merged/shimmed/copied. This allows other asars that were provided to also be scanned and have asar integrity generated for them.
- Extracted common Integrity logic to a single file `integrity.ts`
- Adds unit test for multi-asar apps
2025-02-28 10:03:35 +08:00
Mike Maietta
d90d573ccf test: add test should shim asars with different unpacked dirs (#125) 2025-02-21 16:21:20 -08:00
Mike Maietta
7c0ad6caa5 test: giving steroids to the test suite 💪 (#122)
* purely test suite on steroids

* verify stuff

* more fun verifies

* ok ok ok I'm done

* extend timeout and consolidate to constant for easier usage across tests

* PR feedback :)
Remove warnings by adding transform regex to `ts-jest` and `testMatch`.

* cleanup

* cleanup

* PR feedback & converting `export function` to `export const` in `util.ts`
2025-02-19 15:58:52 +08:00
Erick Zhao
03e27e5a1d test: improve coverage (#102) 2024-06-17 15:15:20 -07:00
Samuel Attard
b6f0c88db4 feat: bump minimum node version to 16 and add tests (#86)
BREAKING CHANGE: Minimum node version is now 16
2023-11-09 11:08:39 -08:00
Samuel Attard
bb304ce10b fix: Revert "feat: bump minimum node version to 16 and add tests (#86)"
This reverts commit 8e2842b4a3.
2023-11-09 11:08:16 -08:00
Samuel Attard
8e2842b4a3 feat: bump minimum node version to 16 and add tests (#86)
* build: add tests

* build: bump deps

* sigh

* build: install rosetta on m1
2023-11-09 10:56:22 -08:00