Skip to content

Commit

Permalink
Chore: Add tests with defaults and explicitly disabled option
Browse files Browse the repository at this point in the history
  • Loading branch information
ark120202 committed Oct 8, 2019
1 parent a5ac4ff commit 76b2dc4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/lib/rules/no-useless-computed-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ ruleTester.run("no-useless-computed-key", rule, {
{ code: "class Foo { 'a'() {} }", options: [{ enforceForClassMembers: true }] },
{ code: "class Foo { [x]() {} }", options: [{ enforceForClassMembers: true }] },
{ code: "class Foo { ['constructor']() {} }", options: [{ enforceForClassMembers: true }] },
{ code: "class Foo { static ['prototype']() {} }", options: [{ enforceForClassMembers: true }] }
{ code: "class Foo { static ['prototype']() {} }", options: [{ enforceForClassMembers: true }] },
"class Foo { ['x']() {} }",
"class Foo { static ['constructor']() {} }",
"class Foo { ['prototype']() {} }",
{ code: "class Foo { ['x']() {} }", options: [{ enforceForClassMembers: false }] },
{ code: "class Foo { static ['constructor']() {} }", options: [{ enforceForClassMembers: false }] },
{ code: "class Foo { ['prototype']() {} }", options: [{ enforceForClassMembers: false }] }
],
invalid: [
{
Expand Down

0 comments on commit 76b2dc4

Please sign in to comment.