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

tools, test: forbid string literal as third argument for assert.strictEqual() and friends #22849

Closed
wants to merge 12 commits into from

Commits on Sep 13, 2018

  1. test: remove string literal message from assertion

    Remove string literal message in assert.strictEqual() call in napi test
    testFinalizer.js.
    Trott committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    abcaf56 View commit details
    Browse the repository at this point in the history
  2. test: remove string literal message in assertions

    Remove string literal message in assert.strictEqual() calls in
    test-async-await.js.
    Trott committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    486f6e8 View commit details
    Browse the repository at this point in the history
  3. 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.
    Trott committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    890c455 View commit details
    Browse the repository at this point in the history
  4. 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.
    Trott committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    d65e189 View commit details
    Browse the repository at this point in the history
  5. 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()`.
    Trott committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    b23cb6c View commit details
    Browse the repository at this point in the history
  6. test: remove string literal from assertion

    Remove string literal from `assert.strictEqual()` call `message`
    parameter and make it a comment above the assertion instead.
    Trott committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    36769be View commit details
    Browse the repository at this point in the history
  7. test: remove string literal message from assertion

    Remove string literal from assert.strictEqual message to improve output
    of AssertionError.
    Trott committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    26f2e99 View commit details
    Browse the repository at this point in the history
  8. test: remove string literal arg from assertion

    Remove unnecessary string literal from assert.deepStrictEqual() call.
    Trott committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    798a6dd View commit details
    Browse the repository at this point in the history
  9. test: remove string literal from assertion

    Remove string literal as assertion message in call to
    assert.strictEqual() in test-dns-resolveany-bad-ancount.
    Trott committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    af1f7c7 View commit details
    Browse the repository at this point in the history
  10. test: remove string literal from assertion

    Remove string literal as assertion message in call to
    assert.strictEqual() in test-dns-lookup.
    Trott committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    8572e6e View commit details
    Browse the repository at this point in the history
  11. 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().
    Trott committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    4b9142c View commit details
    Browse the repository at this point in the history
  12. tools: prevent string literals in some assertions

    String literals provided as the third argument to assert.strictEqual()
    or assert.deepStrictEqual() will mask the values that are causing
    issues. Use a lint rule to prevent such usage.
    Trott committed Sep 13, 2018
    Configuration menu
    Copy the full SHA
    51cd1ea View commit details
    Browse the repository at this point in the history