Skip to content

Fix startup, tests and CI: 1099 tests now pass - #1

Merged
adityatheog merged 1 commit into
mainfrom
fix/remaining
Sep 2, 2026
Merged

Fix startup, tests and CI: 1099 tests now pass#1
adityatheog merged 1 commit into
mainfrom
fix/remaining

Conversation

@adityatheog

Copy link
Copy Markdown
Owner

Summary

The bot could not start. Seventeen modules imported sanitiseForDisplay from
format.js, which does not export it — an ESM SyntaxError at instantiation,
so loadRegistry() threw before the Discord client was constructed.

It shipped because no check had ever run. No lockfile was committed, so
actions/setup-node with cache: npm killed both verify jobs at step 3.

Verified locally

Check Result
npm run syntax 56 files parse, 404 named imports resolve
npm run audit 29 of 29
npm test 1099 pass, 0 fail

What this fixes in CI

Run #8 on main failed 3 of 4 jobs. Both verify jobs died at Audit the project on three false positives in the audit script itself, and the secrets
job matched the audit's own token-shaped placeholder. All four are fixed here.

Not verified

No runtime behaviour against a real Pterodactyl panel or Discord gateway.

The bot could not start. Seventeen modules imported sanitiseForDisplay from
format.js, which does not export it — an ESM SyntaxError at instantiation, so
loadRegistry() threw before the Discord client was constructed.

It shipped because no check had ever run. No lockfile was committed, so
actions/setup-node with cache:npm killed both verify jobs at step 3 and every
later step showed 'skipped'. npm run syntax, which detects the import bug in
seconds, had never executed.

Startup and tooling:
- Re-export sanitiseForDisplay from utils/format.js
- Commit package-lock.json and make the CI cache conditional
- Add load: true so the built Docker image reaches the daemon
- Add LICENSE, correct REQUIRED_TESTS, add an import-resolution check
- node --test tests/*.test.js, since Node 24 rejects a bare directory

Then the suite ran for the first time and found 25 problems.

Source:
- toFiniteNumber accepted anything Number() could coerce, so an empty array
  rendered as '0 B' rather than 'Unknown'
- CONTROL_CHARS_RE lacked the g flag, so sanitiseForDisplay stripped only the
  first control character, and omitted the U+202A-202E bidi override range
- Number(null) is 0, which three call sites trusted: a null session TTL gave a
  zero-millisecond lifetime and a null cooldown silently disabled throttling
- joinSections filtered the help menu's deliberate blank line, which shifted
  every command line up one position and made two commands vanish from paging
- assertValidInteger accepted 1e3 and 0x10 as page numbers
- withResponse is unsupported on the pinned discord.js 14.16.3
- onRetry was unguarded, so a logging failure could mask a panel error

Tests: a panel double that did not record its rollback call, a panelServerId
collision in a fixture, four cases asserting that trimming should reject rather
than normalise, and an assertion that String(bigint) is lossy — it is not,
String(number) is.

56 files parse, 404 named imports resolve, 29 audit checks pass, 1099 tests pass.
@adityatheog
adityatheog merged commit 6fa3819 into main Sep 2, 2026
2 of 4 checks passed
@adityatheog
adityatheog deleted the fix/remaining branch September 2, 2026 17:03
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.

1 participant