Skip to content

test: move to vitest #269

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 31 commits into
base: master
Choose a base branch
from
Open

test: move to vitest #269

wants to merge 31 commits into from

Conversation

9romise
Copy link
Contributor

@9romise 9romise commented Jul 5, 2025

No description provided.

@@ -134,6 +144,7 @@ function analyze(ast, parserOptions) {
key !== "tokens" &&
key !== "trailingComments" &&
typeof value === "object" &&
// @ts-expect-error -- ignore
(typeof value.type === "string" || Array.isArray(value))
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 seems value is always null

Copy link
Contributor Author

@9romise 9romise Jul 7, 2025

Choose a reason for hiding this comment

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

Should I update the logic here? It seems that this part is currently dead code.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. I think getFallbackKeys should probably always return [].
However, it's fine if you fix it in this PR or we fix it in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found similar logic in src:

function fallbackKeysFilter(this: any, key: string): boolean {

I think we can fix it in another PR with more discussions.

Copy link
Member

Choose a reason for hiding this comment

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

I think that src/ast/traverse.ts's fallbackKeysFilter is correct as a process. It assigns to value at L49 😄

(value = this[key]) !== null &&

Copy link
Member

Choose a reason for hiding this comment

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

But, I think it might be a good idea to refactor it to make it easier to read.

@ota-meshi
Copy link
Member

Thank you for working on migrating the testing infrastructure!!!
This PR seems to be a draft, what's the rest of the work?

@9romise
Copy link
Contributor Author

9romise commented Jul 7, 2025

I've updated some of the type definitions in src, and I'm not sure if there will be any bad effects. Can you help check them? Thanks!

Additionally, I used some any and eslint-disable in tests. We can improve them gradually.

@9romise 9romise marked this pull request as ready for review July 7, 2025 02:01
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