Skip to content

test: migrate console_assert message test to snapshot#62801

Open
galaxy4276 wants to merge 1 commit intonodejs:mainfrom
galaxy4276:test/migrate-console-assert-to-snapshot
Open

test: migrate console_assert message test to snapshot#62801
galaxy4276 wants to merge 1 commit intonodejs:mainfrom
galaxy4276:test/migrate-console-assert-to-snapshot

Conversation

@galaxy4276
Copy link
Copy Markdown
Contributor

@galaxy4276 galaxy4276 commented Apr 18, 2026

Summary

Migrates test/message/console_assert from the legacy Python-based test runner (testcfg.py + .out file) to the modern JS snapshot approach.

Changes

  • Add test/fixtures/console/console_assert.js — the fixture script
    (same logic as the old test/message/console_assert.js, with the
    require path adjusted for the new location)
  • Add test/fixtures/console/console_assert.snapshot — expected output
  • Add console/console_assert.js entry to test-node-output-console.mjs
  • Remove test/message/console_assert.js and test/message/console_assert.out

What the test verifies

console.assert(false, Symbol('hello')) should print
Assertion failed Symbol(hello) to stderr without throwing or exiting.
The snapshot captures this expected output.

Refs: #47707

Test plan

  • node --test test/parallel/test-node-output-console.mjs passes
  • No other test/message/ tests affected

Migrate test/message/console_assert from the legacy Python-based
test runner to the JS snapshot approach used by
test-node-output-console.mjs.

The new fixture runs console.assert(false, Symbol('hello')) and
compares against a snapshot, removing the dependency on testcfg.py
and the .out file pattern.

Refs: nodejs#47707

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. test Issues and PRs related to the tests. labels Apr 18, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.69%. Comparing base (31b9e60) to head (de85e12).
⚠️ Report is 51 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #62801      +/-   ##
==========================================
- Coverage   89.70%   89.69%   -0.01%     
==========================================
  Files         706      706              
  Lines      218288   218288              
  Branches    41782    41780       -2     
==========================================
- Hits       195806   195796      -10     
+ Misses      14394    14392       -2     
- Partials     8088     8100      +12     

see 24 files with indirect coverage changes

🚀 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. test Issues and PRs related to the tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants