Permalink
Browse files

Chore: increase camelcase test coverage (#11299)

  • Loading branch information...
RedTn authored and ilyavolodin committed Feb 1, 2019
1 parent 5b14ad1 commit 9005e632d13476880c55f7e3c8a6e450762a5171
Showing with 37 additions and 0 deletions.
  1. +37 −0 tests/lib/rules/camelcase.js
@@ -202,6 +202,11 @@ ruleTester.run("camelcase", rule, {
{
code: "__option_foo__ = 0;",
options: [{ allow: ["__option_foo__"] }]
},
{
code: "foo = { [computedBar]: 0 };",
options: [{ ignoreDestructuring: true }],
parserOptions: { ecmaVersion: 6 }
}
],
invalid: [
@@ -295,6 +300,17 @@ ruleTester.run("camelcase", rule, {
}
]
},
{
code: "var foo = { bar_baz: boom.bam_pow }",
options: [{ ignoreDestructuring: true }],
errors: [
{
messageId: "notCamelCase",
data: { name: "bar_baz" },
type: "Identifier"
}
]
},
{
code: "foo.qux.boom_pow = { bar: boom.bam_pow }",
errors: [
@@ -600,6 +616,16 @@ ruleTester.run("camelcase", rule, {
}
]
},
{
code: "const { no_camelcased = foo_bar } = bar;",
parserOptions: { ecmaVersion: 6 },
errors: [
{
message: "Identifier 'no_camelcased' is not in camel case.",
type: "Identifier"
}
]
},
{
code: "not_ignored_foo = 0;",
options: [{ allow: ["ignored_bar"] }],
@@ -619,6 +645,17 @@ ruleTester.run("camelcase", rule, {
type: "Identifier"
}
]
},
{
code: "foo = { [computed_bar]: 0 };",
options: [{ ignoreDestructuring: true }],
parserOptions: { ecmaVersion: 6 },
errors: [
{
message: "Identifier 'computed_bar' is not in camel case.",
type: "Identifier"
}
]
}
]
});

0 comments on commit 9005e63

Please sign in to comment.