Skip to content

fix: restore firmware test and biome scripts#377

Open
meganetaaan wants to merge 1 commit intodev/v1.0from
ops/fix-firmware-test-ci
Open

fix: restore firmware test and biome scripts#377
meganetaaan wants to merge 1 commit intodev/v1.0from
ops/fix-firmware-test-ci

Conversation

@meganetaaan
Copy link
Copy Markdown
Collaborator

@meganetaaan meganetaaan commented Mar 27, 2026

Restores firmware test execution and scopes Biome to repository files so CI checks can run reliably. Verified with cd firmware && npm run format, npm run lint, and npm run test.

Summary by CodeRabbit

  • Chores
    • Updated build and test infrastructure configuration for improved development workflows.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 27, 2026

📝 Walkthrough

Walkthrough

This PR refines the test build configuration and npm scripts to enforce JavaScript imports in test compilation and narrows the scope of code quality commands. It updates the TypeScript test configuration to disallow .ts extension imports, expands the test file inclusion paths, and adjusts format, lint, and test commands to target specific directories.

Changes

Cohort / File(s) Summary
TypeScript Test Configuration
firmware/tsconfig.test.json
Added allowImportingTsExtensions: false to enforce JavaScript imports and expanded the include paths to compile stackchan/drivers/internal/single-wait-slot.ts and all files under stackchan/drivers/__tests__/**/*.ts.
NPM Package Scripts
firmware/package.json
Updated format and lint scripts to explicitly target stackchan mods tests scripts directories instead of defaulting to the working set. Modified test:unit to execute Node's test runner with explicit glob patterns for unit and driver tests.
Test Source Import Update
firmware/stackchan/drivers/__tests__/single-wait-slot.test.ts
Changed import path for SingleWaitSlot from TypeScript source (../internal/single-wait-slot.ts) to JavaScript build output (../internal/single-wait-slot.js).

Possibly Related PRs

Poem

🐰 npm scripts now tidy,
Config bounds grow stricter still,
Imports hop from .ts to .js
Tests know their rightful hill! 🏔️


🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: restoring firmware tests and fixing biome scripts by scoping them to repository files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ops/fix-firmware-test-ci

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
firmware/package.json (1)

16-16: Consider recursive test globs for future resilience if test structure changes.

The current non-recursive globs (*.test.js) will miss any nested test files. While no nested tests currently exist in tests/unit or stackchan/drivers/__tests__, using **/*.test.js is safer if the test layout evolves.

♻️ Suggested update
-    "test:unit": "rm -rf dist-tests && tsc --project tsconfig.test.json && node --test dist-tests/tests/unit/*.test.js dist-tests/stackchan/drivers/__tests__/*.test.js",
+    "test:unit": "rm -rf dist-tests && tsc --project tsconfig.test.json && node --test dist-tests/tests/unit/**/*.test.js dist-tests/stackchan/drivers/__tests__/**/*.test.js",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@firmware/package.json` at line 16, Update the "test:unit" npm script so it
uses recursive globs to pick up nested test files: replace the non-recursive
patterns (*.test.js) with recursive patterns (**/*.test.js) in the "test:unit"
script entry in package.json so both dist-tests/tests/unit and
dist-tests/stackchan/drivers/__tests__ will include tests in subdirectories.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@firmware/package.json`:
- Line 16: Update the "test:unit" npm script so it uses recursive globs to pick
up nested test files: replace the non-recursive patterns (*.test.js) with
recursive patterns (**/*.test.js) in the "test:unit" script entry in
package.json so both dist-tests/tests/unit and
dist-tests/stackchan/drivers/__tests__ will include tests in subdirectories.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 223f614e-e088-4f9e-8c1f-f33e8f08c743

📥 Commits

Reviewing files that changed from the base of the PR and between 20a4b1b and 2d6a259.

📒 Files selected for processing (3)
  • firmware/package.json
  • firmware/stackchan/drivers/__tests__/single-wait-slot.test.ts
  • firmware/tsconfig.test.json

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