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 9f46ad3 commit 4779cb3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
17 changes: 9 additions & 8 deletions tests/lib/rules/jsx-equals-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// ------------------------------------------------------------------------------

const RuleTester = require('eslint').RuleTester;
const semver = require('semver');
const rule = require('../../../lib/rules/jsx-equals-spacing');

const parsers = require('../../helpers/parsers');
Expand Down Expand Up @@ -86,16 +87,16 @@ ruleTester.run('jsx-equals-spacing', rule, {
},
]),

invalid: parsers.all([
{
invalid: parsers.all([].concat(
semver.satisfies(process.versions.node, '^8 || ^9') ? [] : {
code: '<App foo = {bar} />',
output: '<App foo={bar} />',
errors: [
{ messageId: 'noSpaceBefore', type: 'JSXAttribute' },
{ messageId: 'noSpaceAfter', type: 'JSXAttribute' },
],
},
{
semver.satisfies(process.versions.node, '^8 || ^9') ? [] : {
code: '<App foo = {bar} />',
output: '<App foo={bar} />',
options: ['never'],
Expand All @@ -116,7 +117,7 @@ ruleTester.run('jsx-equals-spacing', rule, {
options: ['never'],
errors: [{ messageId: 'noSpaceAfter', type: 'JSXAttribute' }],
},
{
semver.satisfies(process.versions.node, '^8 || ^9') ? [] : {
code: '<App foo= {bar} bar = {baz} />',
output: '<App foo={bar} bar={baz} />',
options: ['never'],
Expand All @@ -126,7 +127,7 @@ ruleTester.run('jsx-equals-spacing', rule, {
{ messageId: 'noSpaceAfter', type: 'JSXAttribute' },
],
},
{
semver.satisfies(process.versions.node, '^8 || ^9') ? [] : {
code: '<App foo={bar} />',
output: '<App foo = {bar} />',
options: ['always'],
Expand All @@ -147,7 +148,7 @@ ruleTester.run('jsx-equals-spacing', rule, {
options: ['always'],
errors: [{ messageId: 'needSpaceBefore', type: 'JSXAttribute' }],
},
{
semver.satisfies(process.versions.node, '^8 || ^9') ? [] : {
code: '<App foo={bar} bar ={baz} />',
output: '<App foo = {bar} bar = {baz} />',
options: ['always'],
Expand All @@ -156,6 +157,6 @@ ruleTester.run('jsx-equals-spacing', rule, {
{ messageId: 'needSpaceAfter', type: 'JSXAttribute' },
{ messageId: 'needSpaceAfter', type: 'JSXAttribute' },
],
},
]),
}
)),
});
5 changes: 3 additions & 2 deletions tests/lib/rules/no-invalid-html-attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// ------------------------------------------------------------------------------

const RuleTester = require('eslint').RuleTester;
const semver = require('semver');
const rule = require('../../../lib/rules/no-invalid-html-attribute');
const parsers = require('../../helpers/parsers');

Expand Down Expand Up @@ -713,7 +714,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
},
],
},
{
semver.satisfies(process.versions.node, '^8 || ^9') ? [] : {
code: '<a rel={"foobar batgo noopener"}></a>',
errors: [
{
Expand Down Expand Up @@ -957,7 +958,7 @@ ruleTester.run('no-invalid-html-attribute', rule, {
},
],
},
{
semver.satisfies(process.versions.node, '^8 || ^9') ? [] : {
code: '<link rel="shortcut foo"></link>',
errors: [
{
Expand Down
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, {
},
],
},
{
semver.satisfies(process.versions.node, '^8 || ^9') ? [] : {
code: `
class Hello extends React.Component {
GetDerivedStateFromProps() { }
Expand Down

0 comments on commit 4779cb3

Please sign in to comment.