one icon indicating copy to clipboard operation
one copied to clipboard

test(vxrn): add tests for dependency patching

Open zetavg opened this issue 6 months ago • 0 comments

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 avatar Jun 19 '25 14:06 zetavg