Skip to content

Commit

Permalink
split tests
Browse files Browse the repository at this point in the history
  • Loading branch information
binoche9 committed Aug 8, 2023
1 parent 5d28d26 commit bc92533
Showing 1 changed file with 81 additions and 15 deletions.
Expand Up @@ -933,12 +933,52 @@ ruleTester.run('naming-convention', rule, {
],
},
{
code: `
import * as FooBar from 'foo_bar';
import fooBar from 'foo_bar';
import { default as fooBar } from 'foo_bar';
import { foo_bar } from 'foo_bar';
`,
code: "import * as FooBar from 'foo_bar';",
parserOptions,
options: [
{
selector: ['import'],
format: ['PascalCase'],
},
{
selector: ['import'],
modifiers: ['default'],
format: ['camelCase'],
},
],
},
{
code: "import fooBar from 'foo_bar';",
parserOptions,
options: [
{
selector: ['import'],
format: ['PascalCase'],
},
{
selector: ['import'],
modifiers: ['default'],
format: ['camelCase'],
},
],
},
{
code: "import { default as fooBar } from 'foo_bar';",
parserOptions,
options: [
{
selector: ['import'],
format: ['PascalCase'],
},
{
selector: ['import'],
modifiers: ['default'],
format: ['camelCase'],
},
],
},
{
code: "import { foo_bar } from 'foo_bar';",
parserOptions,
options: [
{
Expand Down Expand Up @@ -2142,15 +2182,7 @@ ruleTester.run('naming-convention', rule, {
],
},
{
code: `
// ❌ error
import * as fooBar from 'foo_bar';
// ❌ error
import FooBar from 'foo_bar';
// ❌ error
import { default as foo_bar } from 'foo_bar';
import { foo_bar } from 'foo_bar';
`,
code: "import * as fooBar from 'foo_bar';",
parserOptions,
options: [
{
Expand All @@ -2172,6 +2204,23 @@ ruleTester.run('naming-convention', rule, {
formats: 'PascalCase',
},
},
],
},
{
code: "import FooBar from 'foo_bar';",
parserOptions,
options: [
{
selector: ['import'],
format: ['camelCase'],
},
{
selector: ['import'],
modifiers: ['namespace'],
format: ['PascalCase'],
},
],
errors: [
{
messageId: 'doesNotMatchFormat',
data: {
Expand All @@ -2180,6 +2229,23 @@ ruleTester.run('naming-convention', rule, {
formats: 'camelCase',
},
},
],
},
{
code: "import { default as foo_bar } from 'foo_bar';",
parserOptions,
options: [
{
selector: ['import'],
format: ['camelCase'],
},
{
selector: ['import'],
modifiers: ['namespace'],
format: ['PascalCase'],
},
],
errors: [
{
messageId: 'doesNotMatchFormat',
data: {
Expand Down

0 comments on commit bc92533

Please sign in to comment.