one
one copied to clipboard
test(vxrn): add tests for dependency patching
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
extraPatchesinapplyBuiltInPatches. - Calling
applyDependencyPatchesmultiple 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
.ogfilewhenVXRN_FORCE_PATCHis 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.