Repository navigation
Replace del, mkdirp, slash, replace and querystring with Node built-ins - #102
Merged
Merged
Conversation
fs.rmSync, fs.mkdirSync with recursive, a path separator regex and String.replace cover what the tests used these packages for. The unit tests now parse query strings with URLSearchParams instead of the legacy querystring module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the test-tooling and dependency cleanup.
No open issues 🎉
What changed in this PR
This PR reduces dependencies in CodePush’s test infrastructure by replacing utility packages with Node.js and JavaScript built-ins. The changes are limited to test tooling and dependency metadata.
Changes:
- Use built-in filesystem operations, path normalization, and string replacement in test helpers.
- Replace
querystringparsing withURLSearchParamsin acquisition SDK tests. - Remove unused dependencies and their transitive lockfile entries.
| File | Description |
|---|---|
test/test.mts |
Replace directory utilities and path normalization with built-ins. |
test/codesign.mts |
Create signature directories with fs.mkdirSync. |
src/acquisition-sdk/__tests__/capabilities.test.ts |
Parse and assert query parameters with URLSearchParams. |
src/acquisition-sdk/__tests__/acquisition-rest-mock.ts |
Use URLSearchParams to parse mock update requests. |
package.json |
Remove direct del, mkdirp, and slash dependencies. |
package-lock.json |
Remove unused utility packages and transitive dependencies. |
code-push-plugin-testing-framework/script/testUtil.js |
Replace the replace package with filesystem and string operations. |
code-push-plugin-testing-framework/package.json |
Remove the replace dependency. |
Review effort: Balanced
gsanta
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Replace unnecessary NPM dependencies. All in the context of the E2E test harness, so there is no risk if breaking library code.
Each package gets replaced by a built-in with the same behavior for how we call it:
del,mkdirpfs.rmSyncandfs.mkdirSyncwithrecursive: trueslash\to/regex on the one path that needs itreplaceString.replace, write it backquerystringURLSearchParamsin the unit testsThe lockfile loses about 500 lines, mostly the old
deltree (globby,rimraf,p-mapand friends).