refactor: replace chai with node:assert/strict#103
Merged
Conversation
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.
michael-siek
previously approved these changes
Mar 23, 2026
2a1216a to
2fd1cca
Compare
Contributor
There was a problem hiding this comment.
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/strictacross test files. - Updated
yarn.lockto remove Chai-related packages. - Removed the
chairuntime devDependency frompackage.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.
The assert.notInclude calls are not available in node:assert/strict and were redundant — the preceding deepEqual assertions already cover them.
michael-siek
approved these changes
Mar 23, 2026
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
chaiassertion library with Node.js built-innode:assert/strictacross all 4 test fileschaiand@types/chaidependencies from package.jsonTest plan
yarn testchaiand@types/chairemoved from package.json and yarn.lockNo QA Required