Skip to content
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

Fix 88 tests #3

Merged
merged 2 commits into from
Aug 14, 2024
Merged

Conversation

merrywhether
Copy link

@merrywhether merrywhether commented Aug 14, 2024

To help with un-ts#121 / un-ts#112, fixes a bunch of tests that involved basic logic updates but I didn't get to fixing the tests that weren't as easy without context/backstory on the repo. I added comments explaining the changes I made.

Remaining failures

This leaves 33 failing tests in 5 files with 1 underlying problem in each file AFAICT:

  • test/rules/no-absolute-path.spec.ts (11 failures, fixed in Fix no-absolute-path tests #4)
    All of the invalid tests fail with a confusing error about the rule name (Error rule name should be the same as the name of the rule being tested), and that is masking the underlying error of the configuration not liking the absolute file paths: No matching configuration found for /foo/bar/index.js.. I'm guessing there needs to be some additional configuration to get ESLint to understand the aliasing that's going on here and not interpret the path literally?

  • test/rules/consistent-type-specifier-style.spec.ts (14 failures)
    All of the Flow tests involving the typeof keywords throw errors (A fatal parsing error occurred: Parsing error: Unexpected keyword 'typeof'.). This was confusing because the parser is Babel and the Babel config includes the Flow preset, so not quite sure what is up here. I tried giving it a JS filename (filename: 'bar.js') in case the TS preset was somehow interfering, but that didn't work.

  • test/rules/namespace.spec.ts (5 failures)
    All failing tests are from parser failures (Parser must expose a 'parse' or 'parseForESLint' method (undefined:undefined)) that was hard to solve without having the background on why the tests chose their specific combinations of language target and parser.

  • test/rules/named.spec.ts (1 failure)
    The test of eslint-disable-line can't find the named rule (Definition for rule 'named' was not found), which I assume is some configuration change in flat config?

  • test/cli.spec.ts (2 failures)
    All failing tests are from TypeError: A dynamic import callback was invoked without --experimental-vm-modules errors, which might be a change in transpilation (default is module instead of commons now)? I didn't look deeply into to this one.

So on the bright it seems like there is one class of problem per file? With some pointers, I'm happy to poke a bit more at the remaining tests but I'm not up for source-diving ESLint and friends quite yet.

package.json Show resolved Hide resolved
test/rules/extensions.spec.ts Outdated Show resolved Hide resolved
test/rules/first.spec.ts Show resolved Hide resolved
test/rules/first.spec.ts Show resolved Hide resolved
test/rules/no-cycle.spec.ts Show resolved Hide resolved
test/rules/no-duplicates.spec.ts Show resolved Hide resolved
test/rules/no-empty-named-blocks.spec.ts Show resolved Hide resolved
test/rules/no-extraneous-dependencies.spec.ts Show resolved Hide resolved
test/rules/no-extraneous-dependencies.spec.ts Show resolved Hide resolved
test/rules/unambiguous.spec.ts Show resolved Hide resolved
@SukkaW SukkaW merged commit a78a9a3 into SukkaW:tseslint-v8 Aug 14, 2024
2 of 20 checks passed
@merrywhether merrywhether deleted the help-fix-some-tests branch August 14, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants