Skip to content

refactor: replace chai with node:assert/strict#103

Merged
Garbee merged 10 commits intomainfrom
garbee/remove/chai
Mar 23, 2026
Merged

refactor: replace chai with node:assert/strict#103
Garbee merged 10 commits intomainfrom
garbee/remove/chai

Conversation

@Garbee
Copy link
Copy Markdown
Member

@Garbee Garbee commented Mar 20, 2026

Summary

  • Replaced chai assertion library with Node.js built-in node:assert/strict across all 4 test files
  • Removed chai and @types/chai dependencies from package.json

Test plan

  • All 43 tests pass with yarn test
  • No remaining chai references in source
  • chai and @types/chai removed from package.json and yarn.lock

No QA Required

Garbee added 7 commits March 20, 2026 08:50
All file patterns were simple extension checks (e.g. **/*.js), so
minimatch can be replaced with path.extname() and a Set of allowed
extensions. This removes an external dependency with no behavior change.
Extract isSupportedFile helper that skips path segments starting with
"." (replicating minimatch's default dot:false) and deduplicates the
filter logic between the PR and push code paths.
The yaml package has built-in TypeScript types and a cleaner API,
removing the need for the separate @types/js-yaml package.
@Garbee Garbee self-assigned this Mar 20, 2026
Base automatically changed from garbee/replace/yaml to main March 23, 2026 12:23
@Garbee Garbee marked this pull request as ready for review March 23, 2026 13:09
@Garbee Garbee requested a review from a team as a code owner March 23, 2026 13:09
@Garbee Garbee requested review from Copilot and scottmries March 23, 2026 13:09
michael-siek
michael-siek previously approved these changes Mar 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to remove the Chai assertion dependency by migrating the test suite to Node.js’s built-in node:assert/strict, reducing third-party devDependencies.

Changes:

  • Replaced Chai assertions with node:assert/strict across test files.
  • Updated yarn.lock to remove Chai-related packages.
  • Removed the chai runtime devDependency from package.json.

Reviewed changes

Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
yarn.lock Removes Chai and related transitive dependencies from the lockfile.
package.json Drops chai from devDependencies (but currently leaves @types/chai).
src/utils.test.ts Switches assertion import to node:assert/strict.
src/run.test.ts Rewrites truthy/falsey Chai assertions to strict boolean checks.
src/linter.test.ts Replaces Chai helpers (instanceOf, include, etc.) with Node assert equivalents.
src/git.test.ts Converts many assertions, but introduces duplicated cases and leaves remaining Chai-only assertions later in the file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/git.test.ts
Comment thread package.json
The assert.notInclude calls are not available in node:assert/strict and
were redundant — the preceding deepEqual assertions already cover them.
@Garbee Garbee enabled auto-merge (squash) March 23, 2026 13:15
@Garbee Garbee merged commit 4350dbd into main Mar 23, 2026
8 checks passed
@Garbee Garbee deleted the garbee/remove/chai branch March 23, 2026 13:19
@Garbee Garbee mentioned this pull request Mar 23, 2026
2 tasks
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.

3 participants