Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_runner: add snapshot testing #53169

Merged
merged 3 commits into from
May 30, 2024
Merged

test_runner: add snapshot testing #53169

merged 3 commits into from
May 30, 2024

Commits on May 30, 2024

  1. test_runner: add context.fullName

    This commit adds a fullName getter to the TestContext and
    SuiteContext classes. This is similar to the existing name getter,
    but also includes the name of all ancestor tests/suites.
    
    PR-URL: nodejs#53169
    Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
    Co-authored-by: Jacob Smith <jacob@frende.me>
    cjihrig and JakobJingleheimer committed May 30, 2024
    Configuration menu
    Copy the full SHA
    90e81aa View commit details
    Browse the repository at this point in the history
  2. doc: add context.assert docs

    When context.assert was added, no docs were added. This commit
    adds initial documentation for context.assert because the
    snapshot() function requires them.
    
    PR-URL: nodejs#53169
    Refs: nodejs#52860
    Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
    cjihrig committed May 30, 2024
    Configuration menu
    Copy the full SHA
    851dcdd View commit details
    Browse the repository at this point in the history
  3. test_runner: add snapshot testing

    This commit adds a t.assert.snapshot() method that implements
    snapshot testing. Serialization uses JSON.stringify() by default,
    but users can configure the serialization to meet their needs.
    
    PR-URL: nodejs#53169
    Fixes: nodejs#48260
    Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
    Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
    Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
    cjihrig committed May 30, 2024
    Configuration menu
    Copy the full SHA
    9f6c124 View commit details
    Browse the repository at this point in the history