Remove jest; migrate JS tests to node:assert / node --test#35
Merged
Conversation
The JavaScript package's only dependency was jest, which pulled in a transitive tree (minimatch, picomatch, brace-expansion) that repeatedly surfaced ReDoS advisories requiring version overrides. Migrate the test suite to Node's built-in test runner: - beve.test.js: jest matchers -> node:assert (strictEqual, deepStrictEqual, notStrictEqual); a small assertClose helper covers the float comparisons node:assert lacks. - package.json: drop the jest devDependency and the minimatch/picomatch/ brace-expansion overrides; test script is now `node --test`. - Remove package-lock.json (no dependencies left to lock) and its .gitignore un-ignore rule. - CI: drop the npm cache and `npm ci` step; both require a lockfile and there is nothing to install. node:test/node:assert are stable in the Node 20 the workflow uses. The package is now zero-dependency and the tests are pure stdlib. All 87 tests pass via `node --test`.
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.
Summary
The JavaScript package's only dependency was jest, which pulled in a transitive tree (
minimatch,picomatch,brace-expansion) that repeatedly surfaced ReDoS advisories requiring version overrides inpackage.json. This migrates the test suite to Node's built-in test runner so the package becomes zero-dependency and the alerts go away at the root.Changes
beve.test.js: jest matchers →node:assert(strictEqual,deepStrictEqual,notStrictEqual). A smallassertClosehelper covers the float comparisonsnode:assertlacks. Test names and structure are unchanged.package.json: removed thejestdevDependency and theminimatch/picomatch/brace-expansionoverrides;testscript is nownode --test.package-lock.json: removed (no dependencies left to lock), along with its.gitignoreun-ignore rule..github/workflows/test.yml): dropped the npm cache and thenpm cistep — both require a lockfile and there is nothing to install.node:test/node:assertare stable in the Node 20 the workflow uses.Verification
node --test→ 87/87 tests pass, confirmed with nonode_modulesand no lockfile present (i.e. nothing to install). Noexpect(/jest matchers remain.The package is now zero-dependency and the tests are pure standard library.