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

[v8.x backport] tools, test: forbid string literal as third argument for assert.strictEqual() and friends #22888

Closed
wants to merge 6 commits into from

Commits on Sep 17, 2018

  1. test: improve assertion in test-inspector.js

    Remove an unecessary string literal from assert.strictEqual() call in
    test-inspector.js. The string literal is printed instead of the value
    that causes an error. Removing the string literal allows the value that
    caused the error to be printed. This improves the troubleshooting
    experience when the test fails due to that assertion.
    
    PR-URL: nodejs#22849
    Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Trott committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    75d9ded View commit details
    Browse the repository at this point in the history
  2. test: simplify assertion in http2 tests

    In test-http2-timeout-large-write.js and
    test-http2-timeout-large-write-file.js:
    
    Use assert.ok() on a boolean that the test itself creates and sets,
    rather than assert.strictEqual(). This allows us to use a static message
    without running afoul of the upcoming "do not use string literals with
    assert.strictEqual()" lint rule.
    
    PR-URL: nodejs#22849
    Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Trott committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    c729488 View commit details
    Browse the repository at this point in the history
  3. test: refactor flag check

    Refactor test-vm-run-in-new-context so that check for `--expose-gc` flag
    will not run afoul of an upcoming lint rule that checks that string
    literals are not used for the `message` argument of
    `assert.strictEqual()`.
    
    PR-URL: nodejs#22849
    Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Trott committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    1bd44dd View commit details
    Browse the repository at this point in the history
  4. test: remove string literal from assertion

    Remove string literal from `assert.strictEqual()` call `message`
    parameter and make it a comment above the assertion instead.
    
    PR-URL: nodejs#22849
    Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Trott committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    f6f6cd5 View commit details
    Browse the repository at this point in the history
  5. test: remove string literal from assertion

    Remove string literal as assertion message in call to
    assert.strictEqual() in test-dns-resolveany-bad-ancount.
    
    PR-URL: nodejs#22849
    Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Trott committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    1cd2d5d View commit details
    Browse the repository at this point in the history
  6. test: prepare test-assert for strictEqual linting

    Make minor modifications to test-assert.js to prepare it for linting
    rule that forbids the use of string literals for the third argument of
    assert.strictEqual().
    
    PR-URL: nodejs#22849
    Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
    Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
    Reviewed-By: Anna Henningsen <anna@addaleax.net>
    Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
    Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
    Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
    Trott committed Sep 17, 2018
    Configuration menu
    Copy the full SHA
    be38652 View commit details
    Browse the repository at this point in the history