Skip to content

test(func-call-spacing): make tests more strict #2830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions tests/lib/rules/func-call-spacing.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests are failing, could you have a look at those please?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like it only fails when eslint stylistic is missing.
Any idea why this might be the case?

If not, I can revert adding the column property.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be a difference in how @stylistic/func-call-spacing and ESLint's func-call-spacing rule report locations.

Additionally, the version of @stylistic/eslint-plugin in the project isn’t the latest, which could be causing this issue.

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
*/
'use strict'

const { RuleTester, ESLint } = require('../../eslint-compat')
const semver = require('semver')
const { RuleTester } = require('../../eslint-compat')
const rule = require('../../../lib/rules/func-call-spacing')

const tester = new RuleTester({
Expand Down Expand Up @@ -61,10 +60,9 @@ tester.run('func-call-spacing', rule, {
`,
errors: [
{
message: semver.lt(ESLint.version, '7.0.0')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always good to see legacy code removed 🙂

? 'Unexpected newline between function name and paren.'
: 'Unexpected whitespace between function name and paren.',
line: 3
message: 'Unexpected whitespace between function name and paren.',
line: 3,
column: 20
}
]
},
Expand All @@ -83,7 +81,8 @@ tester.run('func-call-spacing', rule, {
errors: [
{
message: 'Missing space between function name and paren.',
line: 3
line: 3,
column: 20
}
]
},
Expand All @@ -104,10 +103,9 @@ tester.run('func-call-spacing', rule, {
</style>`,
errors: [
{
message: semver.lt(ESLint.version, '7.0.0')
? 'Unexpected newline between function name and paren.'
: 'Unexpected whitespace between function name and paren.',
line: 4
message: 'Unexpected whitespace between function name and paren.',
line: 4,
column: 24
}
]
}
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy