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

Fix: deprecation warning in RuleTester using Node v11 #11009

Merged
merged 1 commit into from Oct 25, 2018

Conversation

@not-an-aardvark
Copy link
Member

commented Oct 23, 2018

What is the purpose of this pull request? (put an "X" next to item)

[x] Bug fix

Tell us about your environment

  • ESLint Version:
  • Node Version:
  • npm Version:

What parser (default, Babel-ESLint, etc.) are you using?

Please show your full configuration:

Configuration

What did you do? Please include the actual source code causing the issue.

"use strict";
const RuleTester = require("eslint").RuleTester;
try {
    new RuleTester().run(
        "foo",
        context => (context.report(context.getSourceCode().ast, "message"), {}),
        { valid: [], invalid: [{ code: "", errors: [5] }] }
    );
} catch (err) {
    // ignore
}

What did you expect to happen?

I expected RuleTester to produce no output because the error was caught.

What actually happened? Please include the actual, raw output from ESLint.

RuleTester printed a deprecation warning:

(node:49648) [DEP0094] DeprecationWarning: assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.

What changes did you make? (Give an overview)

This updates RuleTester to avoid using the deprecated multi-argument assert.fail API in favor of the single-argument version. The single-argument version was introduced in Node v6.12.0, so we can use it since our support only covers Node ^6.14.0.

Is there anything you'd like reviewers to focus on?

Nothing in particular

@not-an-aardvark not-an-aardvark merged commit 9152417 into master Oct 25, 2018

5 checks passed

commit-message Commit message follows guidelines
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor No patch release is pending
Details

@not-an-aardvark not-an-aardvark deleted the fix-deprecation-warning-in-ruletester branch Oct 25, 2018

@eslint eslint bot locked and limited conversation to collaborators Apr 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants
You can’t perform that action at this time.