Skip to content

Commit

Permalink
[Tests] skip some tests that have broken ordering in certain node/esl…
Browse files Browse the repository at this point in the history
…int combinations
  • Loading branch information
ljharb committed Aug 15, 2023
1 parent a7a814e commit 37b02ac
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 25 deletions.
1 change: 1 addition & 0 deletions tests/helpers/parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const parsers = {
TYPESCRIPT_ESLINT: path.join(__dirname, NODE_MODULES, 'typescript-eslint-parser'),
'@TYPESCRIPT_ESLINT': path.join(__dirname, NODE_MODULES, '@typescript-eslint/parser'),
disableNewTS,
skipDueToMultiErrorSorting: semver.satisfies(process.versions.node, '^8 || ^9'),
babelParserOptions: function parserOptions(test, features) {
return Object.assign({}, test.parserOptions, {
requireConfigFile: false,
Expand Down
16 changes: 8 additions & 8 deletions tests/lib/rules/jsx-equals-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,16 @@ ruleTester.run('jsx-equals-spacing', rule, {
},
]),

invalid: parsers.all([
{
invalid: parsers.all([].concat(
parsers.skipDueToMultiErrorSorting ? [] : {
code: '<App foo = {bar} />',
output: '<App foo={bar} />',
errors: [
{ messageId: 'noSpaceBefore', type: 'JSXAttribute' },
{ messageId: 'noSpaceAfter', type: 'JSXAttribute' },
],
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: '<App foo = {bar} />',
output: '<App foo={bar} />',
options: ['never'],
Expand All @@ -116,7 +116,7 @@ ruleTester.run('jsx-equals-spacing', rule, {
options: ['never'],
errors: [{ messageId: 'noSpaceAfter', type: 'JSXAttribute' }],
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: '<App foo= {bar} bar = {baz} />',
output: '<App foo={bar} bar={baz} />',
options: ['never'],
Expand All @@ -126,7 +126,7 @@ ruleTester.run('jsx-equals-spacing', rule, {
{ messageId: 'noSpaceAfter', type: 'JSXAttribute' },
],
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: '<App foo={bar} />',
output: '<App foo = {bar} />',
options: ['always'],
Expand All @@ -147,7 +147,7 @@ ruleTester.run('jsx-equals-spacing', rule, {
options: ['always'],
errors: [{ messageId: 'needSpaceBefore', type: 'JSXAttribute' }],
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: '<App foo={bar} bar ={baz} />',
output: '<App foo = {bar} bar = {baz} />',
options: ['always'],
Expand All @@ -156,6 +156,6 @@ ruleTester.run('jsx-equals-spacing', rule, {
{ messageId: 'needSpaceAfter', type: 'JSXAttribute' },
{ messageId: 'needSpaceAfter', type: 'JSXAttribute' },
],
},
]),
}
)),
});
4 changes: 2 additions & 2 deletions tests/lib/rules/jsx-indent.js
Original file line number Diff line number Diff line change
Expand Up @@ -2779,7 +2779,7 @@ const Component = () => (
},
],
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: `
<div>
text
Expand Down Expand Up @@ -2813,7 +2813,7 @@ const Component = () => (
},
],
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: `
<div>
\t text
Expand Down
14 changes: 7 additions & 7 deletions tests/lib/rules/jsx-no-useless-fragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ ruleTester.run('jsx-no-useless-fragment', rule, {
options: [{ allowExpressions: true }],
},
]),
invalid: parsers.all([
invalid: parsers.all([].concat(
{
code: '<></>',
output: null,
Expand All @@ -99,7 +99,7 @@ ruleTester.run('jsx-no-useless-fragment', rule, {
errors: [{ messageId: 'NeedsMoreChildren', type: 'JSXFragment' }],
features: ['fragment'],
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: '<p>moo<>foo</></p>',
output: '<p>moofoo</p>',
errors: [
Expand All @@ -114,7 +114,7 @@ ruleTester.run('jsx-no-useless-fragment', rule, {
errors: [{ messageId: 'NeedsMoreChildren' }],
features: ['fragment'],
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: '<p><>{meow}</></p>',
output: '<p>{meow}</p>',
errors: [
Expand Down Expand Up @@ -177,7 +177,7 @@ ruleTester.run('jsx-no-useless-fragment', rule, {
errors: [{ messageId: 'NeedsMoreChildren', type: 'JSXFragment' }],
features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: '<div><>foo</></div>',
output: '<div>foo</div>',
errors: [
Expand Down Expand Up @@ -247,7 +247,7 @@ ruleTester.run('jsx-no-useless-fragment', rule, {
errors: [{ messageId: 'ChildOfHtmlElement', type: 'JSXFragment' }],
features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: `
const Comp = () => (
<html>
Expand All @@ -274,6 +274,6 @@ ruleTester.run('jsx-no-useless-fragment', rule, {
errors: [{ messageId: 'NeedsMoreChildren', type: 'JSXFragment' }],
output: '<Foo>{moo}</Foo>',
features: ['fragment', 'no-ts-old'], // TODO: FIXME: remove no-ts-old
},
]),
}
)),
});
14 changes: 7 additions & 7 deletions tests/lib/rules/no-invalid-html-attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
code: '<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#fff" />',
},
]),
invalid: parsers.all([
invalid: parsers.all([].concat(
{
code: '<a rel="alternatex"></a>',
errors: [
Expand Down Expand Up @@ -713,7 +713,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
},
],
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: '<a rel={"foobar batgo noopener"}></a>',
errors: [
{
Expand Down Expand Up @@ -782,7 +782,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
},
],
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: '<a rel={" batgo noopener"}></a>',
errors: [
{
Expand Down Expand Up @@ -913,7 +913,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
},
],
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: '<link rel="shortcut foo"></link>',
errors: [
{
Expand Down Expand Up @@ -957,7 +957,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
},
],
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: '<link rel="shortcut foo"></link>',
errors: [
{
Expand Down Expand Up @@ -1832,6 +1832,6 @@ ruleTester.run('no-invalid-html-attribute', rule, {
type: 'Literal',
},
],
},
]),
}
)),
});
2 changes: 1 addition & 1 deletion tests/lib/rules/no-typos.js
Original file line number Diff line number Diff line change
Expand Up @@ -1873,7 +1873,7 @@ ruleTester.run('no-typos', rule, {
},
],
},
{
parsers.skipDueToMultiErrorSorting ? [] : {
code: `
class Hello extends React.Component {
GetDerivedStateFromProps() { }
Expand Down

0 comments on commit 37b02ac

Please sign in to comment.