Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

  • Install @nevware21/tripwire package
  • Update all test files to import from @nevware21/tripwire instead of chai
    • Replace import { assert } from "chai" with import { assert } from "@nevware21/tripwire"
    • Replace import { assert, expect } from "chai" with import { assert, expect } from "@nevware21/tripwire"
  • Update chai expect syntax to tripwire syntax where needed
  • Remove chai and @types/chai from package.json devDependencies
  • Run tests to verify changes work correctly (981 passing)
  • Revert unintended preprocessor changes to source files
  • Use recommended version range for tripwire (">= 0.1.5 < 2.x")
  • Final validation and cleanup

Summary

Successfully replaced all usages of chai with @nevware21/tripwire:

  • Updated 13 test files to import from @nevware21/tripwire
  • Removed chai and @types/chai from both root and lib package.json
  • Fixed expect syntax to use tripwire API (expect().to.be.equal instead of expect().to.equal)
  • Reverted unintended preprocessor directive changes in source files (base.ts, debug.ts, nativePromise.ts, taskScheduler.ts)
  • Updated tripwire to use recommended version range (">= 0.1.5 < 2.x") matching the pattern used for other @nevware21 packages

Note on Circular Dependency

The circular dependency between @nevware21/tripwire and @nevware21/ts-async exists but does not prevent the package from working correctly in practice, as tripwire uses ts-async as a runtime dependency while ts-async uses tripwire as a devDependency only for testing.

Original prompt

This section details on the original issue you should resolve

<issue_title>chore: Remove usage of chai from the repo and use @nevware21/tripwire</issue_title>
<issue_description>Update the repo to use tripwire for the assertions, replacing all usages of chai. Use the native tripwire assertions rather than the shim.

This includes removing the following packages

  • @types/chai
  • chai</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits February 4, 2026 04:32
…ai dependencies

Co-authored-by: nev21 <82737406+nev21@users.noreply.github.com>
…f expect().to.equal)

Co-authored-by: nev21 <82737406+nev21@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove chai and implement tripwire for assertions Replace chai with @nevware21/tripwire for test assertions Feb 4, 2026
Copilot AI requested a review from nev21 February 4, 2026 04:40
@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.03%. Comparing base (b8eeebf) to head (6c2b923).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #430   +/-   ##
=======================================
  Coverage   99.03%   99.03%           
=======================================
  Files          19       19           
  Lines         727      727           
  Branches      183      183           
=======================================
  Hits          720      720           
  Misses          7        7           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…romise.ts, taskScheduler.ts)

Co-authored-by: nev21 <82737406+nev21@users.noreply.github.com>
Copilot AI requested a review from nev21 February 4, 2026 05:09
Copilot AI and others added 2 commits February 4, 2026 05:12
Copilot AI requested a review from nev21 February 4, 2026 05:13
@nev21 nev21 marked this pull request as ready for review February 4, 2026 05:15
Copilot AI review requested due to automatic review settings February 4, 2026 05:15
Copy link

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 pull request replaces the chai assertion library with @nevware21/tripwire across the entire test suite. The changes remove chai and @types/chai from dependencies and update all test files to use tripwire for assertions.

Changes:

  • Removed chai and @types/chai from both root and lib package.json devDependencies
  • Updated 13 test files to import from @nevware21/tripwire instead of chai
  • Fixed expect syntax to use tripwire's API (expect().to.be.equal() instead of expect().to.equal())

Reviewed changes

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Removed @types/chai from root package devDependencies
lib/package.json Removed chai and @types/chai, added @nevware21/tripwire ">= 0.1.5 < 2.x", alphabetically sorted devDependencies, removed trailing whitespace
lib/test/src/scheduler/scheduler.test.ts Updated import from chai to @nevware21/tripwire
lib/test/src/promise/use.doAwait.test.ts Updated import from chai to @nevware21/tripwire
lib/test/src/promise/use.await.test.ts Updated import from chai to @nevware21/tripwire
lib/test/src/promise/unhandledRejectionEvent.test.ts Updated import from chai to @nevware21/tripwire
lib/test/src/promise/timeoutPromise.test.ts Updated import from chai to @nevware21/tripwire
lib/test/src/promise/sync.promise.test.ts Updated import from chai to @nevware21/tripwire
lib/test/src/promise/idle.promise.test.ts Updated import from chai to @nevware21/tripwire
lib/test/src/promise/event.test.ts Updated import from chai to @nevware21/tripwire
lib/test/src/promise/await.test.ts Updated import from chai to @nevware21/tripwire, fixed expect syntax to use .to.be.equal()
lib/test/src/promise/async.promise.test.ts Updated import from chai to @nevware21/tripwire
lib/test/src/helpers/iterForOfAsync.test.ts Updated import from chai to @nevware21/tripwire
lib/test/src/helpers/doWhileAsync.test.ts Updated import from chai to @nevware21/tripwire
lib/test/src/helpers/arrForEachAsync.test.ts Updated import from chai to @nevware21/tripwire
common/config/rush/npm-shrinkwrap.json Removed chai and related packages, added @nevware21/tripwire and its dependencies, updated various package versions
Files not reviewed (1)
  • common/config/rush/npm-shrinkwrap.json: Language not supported

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

Copy link
Contributor

@nev21 nev21 left a comment

Choose a reason for hiding this comment

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

Co-authored-by: nev21 <82737406+nev21@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 4, 2026

@copilot see #430 (comment)

I'm unable to access the specific review comment at that link. Could you please copy the relevant feedback here or let me know what needs to be addressed?

Copy link
Contributor

@nev21 nev21 left a comment

Choose a reason for hiding this comment

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

see comment about cyclic dependency projects

Copy link

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

Copilot reviewed 16 out of 17 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • common/config/rush/npm-shrinkwrap.json: Language not supported

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

…al packages

Co-authored-by: nev21 <82737406+nev21@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 4, 2026

see comment about cyclic dependency projects

Addressed in commit 6c2b923 - removed the invalid cyclicDependencyProjects configuration from rush.json.

Copy link

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

Copilot reviewed 15 out of 16 changed files in this pull request and generated no new comments.

Files not reviewed (1)
  • common/config/rush/npm-shrinkwrap.json: Language not supported

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

Copy link
Contributor

@nevware21-bot nevware21-bot left a comment

Choose a reason for hiding this comment

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

Approved by nevware21-bot

@nev21 nev21 merged commit 9b0b5bc into main Feb 4, 2026
18 checks passed
@nev21 nev21 deleted the copilot/remove-chai-and-use-tripwire branch February 4, 2026 06:52
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.

chore: Remove usage of chai from the repo and use @nevware21/tripwire

3 participants