Skip to content

fix(test): convert assert.ok to vitest expect in policies.test.js#752

Merged
ericksoa merged 1 commit into
mainfrom
fix/policies-test-vitest-migration
Mar 24, 2026
Merged

fix(test): convert assert.ok to vitest expect in policies.test.js#752
ericksoa merged 1 commit into
mainfrom
fix/policies-test-vitest-migration

Conversation

@cv

@cv cv commented Mar 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

PR #356 added tests using node:assert which is incompatible with the vitest runner. This breaks test-unit on main and every open PR.

Converts assert.ok() to vitest expect().toBeTruthy() / expect().toBe().

Test plan

  • CI passes on this PR

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Updated test assertions for package manager preset schema validation to improve test robustness.

PR #356 added tests using node:assert which is not compatible with the
vitest runner. Converts to vitest expect() to fix test-unit on main.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 02e433cc-ec9f-4ffd-8bc8-8901ad779f94

📥 Commits

Reviewing files that changed from the base of the PR and between e1097a6 and 7234676.

📒 Files selected for processing (1)
  • test/policies.test.js

📝 Walkthrough

Walkthrough

The test file test/policies.test.js is being refactored to replace Node.js assert.ok statements with Vitest expect assertions across package-manager preset schema tests and binaries-section tests, maintaining existing test logic and behavior.

Changes

Cohort / File(s) Summary
Test Assertion Refactoring
test/policies.test.js
Convert preset schema assertions for pypi and npm from assert.ok to expect().toBeTruthy() and expect().toBe() patterns; update binaries-section test assertions to use Vitest expect syntax.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 With whiskers twitched and hopeful cheer,
Our tests now speak in Vitest clear!
From assert.ok to expect so bright,
The bunny jumps—assertions take flight! ✨

🚥 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 describes the main change: converting assert.ok to vitest expect assertions in the policies.test.js file, which is the primary objective of this pull request.
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 fix/policies-test-vitest-migration

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

@cv cv requested a review from ericksoa March 24, 2026 00:21
@ericksoa ericksoa merged commit 60aa684 into main Mar 24, 2026
7 checks passed
@cv cv deleted the fix/policies-test-vitest-migration branch March 24, 2026 00:28
Ryuketsukami pushed a commit to Ryuketsukami/NemoClaw that referenced this pull request Mar 24, 2026
…IDIA#752)

PR NVIDIA#356 added tests using node:assert which is not compatible with the
vitest runner. Converts to vitest expect() to fix test-unit on main.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
alexcode-cc pushed a commit to alexcode-cc/NemoClaw that referenced this pull request Mar 24, 2026
…IDIA#752)

PR NVIDIA#356 added tests using node:assert which is not compatible with the
vitest runner. Converts to vitest expect() to fix test-unit on main.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
HagegeR pushed a commit to HagegeR/NemoClaw that referenced this pull request Mar 24, 2026
…IDIA#752)

PR NVIDIA#356 added tests using node:assert which is not compatible with the
vitest runner. Converts to vitest expect() to fix test-unit on main.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jessesanford pushed a commit to jessesanford/NemoClaw that referenced this pull request Mar 24, 2026
…IDIA#752)

PR NVIDIA#356 added tests using node:assert which is not compatible with the
vitest runner. Converts to vitest expect() to fix test-unit on main.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jacobtomlinson pushed a commit to jacobtomlinson/NemoClaw that referenced this pull request Apr 30, 2026
…IDIA#752)

PR NVIDIA#356 added tests using node:assert which is not compatible with the
vitest runner. Converts to vitest expect() to fix test-unit on main.

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@wscurran wscurran added the bug-fix PR fixes a bug or regression label Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug-fix PR fixes a bug or regression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants