Skip to content

Conversation

@zetavg
Copy link
Collaborator

@zetavg zetavg commented Jun 19, 2025

This commit introduces tests for the dependency patching feature in packages/vxrn/src/utils/patches.ts.

The tests cover the following scenarios:

  • Applying multiple patch rules to the same file.
  • Merging extraPatches in applyBuiltInPatches.
  • Calling applyDependencyPatches multiple times with different inputs.

For each test case, the following is verified:

  • Correct creation and content of the .ogfile.
  • Skipping of already patched files.
  • Re-application of patches based on the .ogfile when VXRN_FORCE_PATCH is set.

The patches.ts file has been modified for better testability, allowing customization of node_modules path and built-in patches.

A new script test:deps-patching has been added to packages/vxrn/package.json to run these tests.

@zetavg zetavg force-pushed the feat/test-deps-patching branch from ab2c3aa to 21eb0cf Compare June 19, 2025 14:52
This commit introduces tests for the dependency patching feature in `packages/vxrn/src/utils/patches.ts`.

The tests cover the following scenarios:
- Applying multiple patch rules to the same file.
- Merging `extraPatches` in `applyBuiltInPatches`.
- Calling `applyDependencyPatches` multiple times with different inputs.

For each test case, the following is verified:
- Correct creation and content of the `.ogfile`.
- Skipping of already patched files.
- Re-application of patches based on the `.ogfile` when `VXRN_FORCE_PATCH` is set.

The `patches.ts` file has been modified for better testability, allowing customization of `node_modules` path and built-in patches.

A new script `test:deps-patching` has been added to `packages/vxrn/package.json` to run these tests.
@zetavg zetavg force-pushed the feat/test-deps-patching branch from 21eb0cf to ae91a0b Compare June 19, 2025 14:55
Base automatically changed from fix-patching to main June 19, 2025 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants