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

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 added bug ESLint is working incorrectly core Relates to ESLint's core APIs and features accepted There is consensus among the team that this change meets the criteria for inclusion labels Oct 23, 2018
@not-an-aardvark not-an-aardvark merged commit 9152417 into master Oct 25, 2018
@not-an-aardvark not-an-aardvark deleted the fix-deprecation-warning-in-ruletester branch October 25, 2018 21:09
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Apr 24, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Apr 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants