Skip to content

Commit

Permalink
Add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Aug 6, 2022
1 parent 4534101 commit fb89707
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions packages/eslint-plugin/tests/rules/member-ordering.test.ts
Expand Up @@ -1264,6 +1264,16 @@ class Foo {
`,
options: [{ default: ['method', 'field', 'static-initialization'] }],
},
{
code: `
class Foo {
f = 1;
static {}
m() {}
}
`,
options: [{ default: ['field', 'static-initialization', 'method'] }],
},
`
interface Foo {
[Z: string]: any;
Expand Down Expand Up @@ -4050,6 +4060,48 @@ class Foo {
},
],
},
{
code: `
class Foo {
f = 1;
static {}
m() {}
}
`,
options: [{ default: ['static-initialization', 'field', 'method'] }],
errors: [
{
messageId: 'incorrectGroupOrder',
data: {
name: 'static block',
rank: 'field',
},
line: 4,
column: 3,
},
],
},
{
code: `
class Foo {
static {}
f = 1;
m() {}
}
`,
options: [{ default: ['field', 'static-initialization', 'method'] }],
errors: [
{
messageId: 'incorrectGroupOrder',
data: {
name: 'f',
rank: 'static initialization',
},
line: 4,
column: 3,
},
],
},
],
};

Expand Down

0 comments on commit fb89707

Please sign in to comment.