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

test: add infer-parser tests #30

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

43081j
Copy link
Contributor

@43081j 43081j commented Jan 31, 2025

Adds the infer-parser tests from prettier.

Also updates the runCLI util to only execute the binary once a test actually runs.

});

// TODO (43081j): in prettier, this tests that it exits with 0 for
// whatever reason. should we do the same?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need to decide what the right behaviour is here

Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest we add a fourth internal only "main" flag/command called "dump" or "echo" or something like that, which we consider enabled when the other 3 ones aren't, and we use that to decide what to output exactly, and we largely align ourselves with Prettier v3.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Just mentioning it here that this forth "mode" exists internally now, I called it "dump".

@43081j
Copy link
Contributor Author

43081j commented Feb 2, 2025

depends on #33 now

@fabiospampinato
Copy link
Collaborator

#33 got fixed, let me know when we should be ready for merging this.

43081j added 3 commits March 2, 2025 20:49
Adds the `infer-parser` tests from prettier.

Also updates the `runCLI` util to only execute the binary once a test
actually runs.
@43081j 43081j force-pushed the infer-parser-test branch from b7e80e4 to 4ef2b89 Compare March 2, 2025 20:05
@43081j
Copy link
Contributor Author

43081j commented Mar 2, 2025

Blocked by #51

@@ -182,7 +182,7 @@ async function runGlobs(options: Options, pluginsDefaultOptions: PluginsOptions,
const filePath = filesPathsTargets[i];
const fileRelativePath = fastRelativePath(rootPath, filePath);
//TODO: Make sure the error is syntax-highlighted when possible
if (options.check || options.write) {
if (options.check || options.write || options.dump) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

importantly , this changed

this is what makes errors now log out when you're in dump mode (the same as prettier)

@fabiospampinato fabiospampinato force-pushed the main branch 4 times, most recently from 34e0257 to f8dc396 Compare March 6, 2025 00:45
@fabiospampinato
Copy link
Collaborator

#51 was addressed, do we need anything else for this PR?

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