Skip to content

Commit 37b02ac

Browse files
committed
[Tests] skip some tests that have broken ordering in certain node/eslint combinations
1 parent a7a814e commit 37b02ac

File tree

6 files changed

+26
-25
lines changed

6 files changed

+26
-25
lines changed

tests/helpers/parsers.js

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const parsers = {
3939
TYPESCRIPT_ESLINT: path.join(__dirname, NODE_MODULES, 'typescript-eslint-parser'),
4040
'@TYPESCRIPT_ESLINT': path.join(__dirname, NODE_MODULES, '@typescript-eslint/parser'),
4141
disableNewTS,
42+
skipDueToMultiErrorSorting: semver.satisfies(process.versions.node, '^8 || ^9'),
4243
babelParserOptions: function parserOptions(test, features) {
4344
return Object.assign({}, test.parserOptions, {
4445
requireConfigFile: false,

tests/lib/rules/jsx-equals-spacing.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,16 @@ ruleTester.run('jsx-equals-spacing', rule, {
8686
},
8787
]),
8888

89-
invalid: parsers.all([
90-
{
89+
invalid: parsers.all([].concat(
90+
parsers.skipDueToMultiErrorSorting ? [] : {
9191
code: '<App foo = {bar} />',
9292
output: '<App foo={bar} />',
9393
errors: [
9494
{ messageId: 'noSpaceBefore', type: 'JSXAttribute' },
9595
{ messageId: 'noSpaceAfter', type: 'JSXAttribute' },
9696
],
9797
},
98-
{
98+
parsers.skipDueToMultiErrorSorting ? [] : {
9999
code: '<App foo = {bar} />',
100100
output: '<App foo={bar} />',
101101
options: ['never'],
@@ -116,7 +116,7 @@ ruleTester.run('jsx-equals-spacing', rule, {
116116
options: ['never'],
117117
errors: [{ messageId: 'noSpaceAfter', type: 'JSXAttribute' }],
118118
},
119-
{
119+
parsers.skipDueToMultiErrorSorting ? [] : {
120120
code: '<App foo= {bar} bar = {baz} />',
121121
output: '<App foo={bar} bar={baz} />',
122122
options: ['never'],
@@ -126,7 +126,7 @@ ruleTester.run('jsx-equals-spacing', rule, {
126126
{ messageId: 'noSpaceAfter', type: 'JSXAttribute' },
127127
],
128128
},
129-
{
129+
parsers.skipDueToMultiErrorSorting ? [] : {
130130
code: '<App foo={bar} />',
131131
output: '<App foo = {bar} />',
132132
options: ['always'],
@@ -147,7 +147,7 @@ ruleTester.run('jsx-equals-spacing', rule, {
147147
options: ['always'],
148148
errors: [{ messageId: 'needSpaceBefore', type: 'JSXAttribute' }],
149149
},
150-
{
150+
parsers.skipDueToMultiErrorSorting ? [] : {
151151
code: '<App foo={bar} bar ={baz} />',
152152
output: '<App foo = {bar} bar = {baz} />',
153153
options: ['always'],
@@ -156,6 +156,6 @@ ruleTester.run('jsx-equals-spacing', rule, {
156156
{ messageId: 'needSpaceAfter', type: 'JSXAttribute' },
157157
{ messageId: 'needSpaceAfter', type: 'JSXAttribute' },
158158
],
159-
},
160-
]),
159+
}
160+
)),
161161
});

tests/lib/rules/jsx-indent.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2779,7 +2779,7 @@ const Component = () => (
27792779
},
27802780
],
27812781
},
2782-
{
2782+
parsers.skipDueToMultiErrorSorting ? [] : {
27832783
code: `
27842784
<div>
27852785
text
@@ -2813,7 +2813,7 @@ const Component = () => (
28132813
},
28142814
],
28152815
},
2816-
{
2816+
parsers.skipDueToMultiErrorSorting ? [] : {
28172817
code: `
28182818
<div>
28192819
\t text

tests/lib/rules/jsx-no-useless-fragment.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ ruleTester.run('jsx-no-useless-fragment', rule, {
8686
options: [{ allowExpressions: true }],
8787
},
8888
]),
89-
invalid: parsers.all([
89+
invalid: parsers.all([].concat(
9090
{
9191
code: '<></>',
9292
output: null,
@@ -99,7 +99,7 @@ ruleTester.run('jsx-no-useless-fragment', rule, {
9999
errors: [{ messageId: 'NeedsMoreChildren', type: 'JSXFragment' }],
100100
features: ['fragment'],
101101
},
102-
{
102+
parsers.skipDueToMultiErrorSorting ? [] : {
103103
code: '<p>moo<>foo</></p>',
104104
output: '<p>moofoo</p>',
105105
errors: [
@@ -114,7 +114,7 @@ ruleTester.run('jsx-no-useless-fragment', rule, {
114114
errors: [{ messageId: 'NeedsMoreChildren' }],
115115
features: ['fragment'],
116116
},
117-
{
117+
parsers.skipDueToMultiErrorSorting ? [] : {
118118
code: '<p><>{meow}</></p>',
119119
output: '<p>{meow}</p>',
120120
errors: [
@@ -177,7 +177,7 @@ ruleTester.run('jsx-no-useless-fragment', rule, {
177177
errors: [{ messageId: 'NeedsMoreChildren', type: 'JSXFragment' }],
178178
features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old
179179
},
180-
{
180+
parsers.skipDueToMultiErrorSorting ? [] : {
181181
code: '<div><>foo</></div>',
182182
output: '<div>foo</div>',
183183
errors: [
@@ -247,7 +247,7 @@ ruleTester.run('jsx-no-useless-fragment', rule, {
247247
errors: [{ messageId: 'ChildOfHtmlElement', type: 'JSXFragment' }],
248248
features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old
249249
},
250-
{
250+
parsers.skipDueToMultiErrorSorting ? [] : {
251251
code: `
252252
const Comp = () => (
253253
<html>
@@ -274,6 +274,6 @@ ruleTester.run('jsx-no-useless-fragment', rule, {
274274
errors: [{ messageId: 'NeedsMoreChildren', type: 'JSXFragment' }],
275275
output: '<Foo>{moo}</Foo>',
276276
features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old
277-
},
278-
]),
277+
}
278+
)),
279279
});

tests/lib/rules/no-invalid-html-attribute.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
234234
code: '<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#fff" />',
235235
},
236236
]),
237-
invalid: parsers.all([
237+
invalid: parsers.all([].concat(
238238
{
239239
code: '<a rel="alternatex"></a>',
240240
errors: [
@@ -713,7 +713,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
713713
},
714714
],
715715
},
716-
{
716+
parsers.skipDueToMultiErrorSorting ? [] : {
717717
code: '<a rel={"foobar batgo noopener"}></a>',
718718
errors: [
719719
{
@@ -782,7 +782,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
782782
},
783783
],
784784
},
785-
{
785+
parsers.skipDueToMultiErrorSorting ? [] : {
786786
code: '<a rel={" batgo noopener"}></a>',
787787
errors: [
788788
{
@@ -913,7 +913,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
913913
},
914914
],
915915
},
916-
{
916+
parsers.skipDueToMultiErrorSorting ? [] : {
917917
code: '<link rel="shortcut foo"></link>',
918918
errors: [
919919
{
@@ -957,7 +957,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
957957
},
958958
],
959959
},
960-
{
960+
parsers.skipDueToMultiErrorSorting ? [] : {
961961
code: '<link rel="shortcut foo"></link>',
962962
errors: [
963963
{
@@ -1832,6 +1832,6 @@ ruleTester.run('no-invalid-html-attribute', rule, {
18321832
type: 'Literal',
18331833
},
18341834
],
1835-
},
1836-
]),
1835+
}
1836+
)),
18371837
});

tests/lib/rules/no-typos.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,7 @@ ruleTester.run('no-typos', rule, {
18731873
},
18741874
],
18751875
},
1876-
{
1876+
parsers.skipDueToMultiErrorSorting ? [] : {
18771877
code: `
18781878
class Hello extends React.Component {
18791879
GetDerivedStateFromProps() { }

0 commit comments

Comments
 (0)