Skip to content

fix: bugs found while adding test coverage - #107

Merged
bnb merged 5 commits into
mainfrom
bnb/coverage-fixes
Oct 21, 2026
Merged

bnb merged 5 commits into
mainfrom
bnb/coverage-fixes

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

Fixes four bugs the new coverage tests turned up.

core: releases without files. A release in index.json with no files key crashed core with Cannot convert undefined or null to object, because files.available fell back to undefined and the links loop called Object.keys on it. It now falls back to [], so the release gets available: [] and empty links. Adds core/test/files.js.

parsefiles: source tarballs. The src case assigned files[0] twice, so the .tar.gz name was overwritten and only .tar.xz came back. It now lists both, the same way headers does. Updates test/data/expected.json. Core still depends on @nodevu/parsefiles@^0.0.3, so core's output won't change until that range is bumped.

core: now.json. updateStaticNow.js stringified the DateTime and then write() stringified it again, so the file held a quoted string inside a string. Every reader undid that with JSON.parse. The script now passes the DateTime straight to write(). The snapshot is re-encoded, and combos.js, dynamic-values.js and ranges' emptyFields.test.js read it directly.

static: undeclared dependency. The build scripts require @nodevu/core, but static's package.json never listed it, so they only worked after installing every workspace (as the nightly build does). It's now a devDependency, and npm install -w static links it.

botandbang and others added 5 commits October 21, 2026 00:47
A release in index.json with no files key made core throw, since files.available fell back to undefined and the links loop called Object.keys on it. It now falls back to an empty array.
The src case assigned files[0] twice, so the .tar.gz name was overwritten and only the .tar.xz was returned. It now lists both, like headers.
updateStaticNow stringified the DateTime and write() stringified it again, so every reader had to JSON.parse it a second time. The script now hands write() the DateTime, the snapshot is re-encoded, and the extra JSON.parse calls are gone.
The build scripts require @nodevu/core but static never listed it, so it only resolved when every workspace was installed. npm install -w static now links it.
Co-authored-by: botandbang <337765928+botandbang@users.noreply.github.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​fast-check@​4.10.210010010089100

View full report

@bnb
bnb merged commit 9eb3a7c into main Oct 21, 2026
29 checks passed
@bnb
bnb deleted the bnb/coverage-fixes branch October 21, 2026 12:59
@github-actions github-actions Bot mentioned this pull request Oct 21, 2026
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