Skip to content

Commit

Permalink
using unIndent
Browse files Browse the repository at this point in the history
  • Loading branch information
imjordanxd committed Sep 15, 2024
1 parent 825c2fc commit 1b33a77
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/lib/rules/no-useless-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

const rule = require("../../../lib/rules/no-useless-constructor");
const RuleTester = require("../../../lib/rule-tester/rule-tester");
const { unIndent } = require("../../_utils");

//------------------------------------------------------------------------------
// Tests
Expand Down Expand Up @@ -136,13 +137,23 @@ ruleTester.run("no-useless-constructor", rule, {
}]
},
{
code: "class A { foo = \"bar\"\nconstructor() { }\n[0]() { } }",
code: unIndent`
class A {
foo = 'bar'
constructor() { }
[0]() { }
}`,
languageOptions: { ecmaVersion: 2022 },
errors: [{
...error,
suggestions: [{
messageId: "removeConstructor",
output: "class A { foo = \"bar\"\n;\n[0]() { } }"
output: unIndent`
class A {
foo = 'bar'
;
[0]() { }
}`
}]
}]
}
Expand Down

0 comments on commit 1b33a77

Please sign in to comment.