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

Correct standalone test environment variable #8080

Merged
merged 1 commit into from Apr 18, 2020
Merged

Correct standalone test environment variable #8080

merged 1 commit into from Apr 18, 2020

Conversation

fisker
Copy link
Sponsor Member

@fisker fisker commented Apr 18, 2020

refs:

  • I’ve added tests to confirm my change works.
  • (If changing the API or CLI) I’ve documented the changes I’ve made (in the docs/ directory)
  • (If the change is user-facing) I’ve added my changes to changelog_unreleased/*/pr-XXXX.md file following changelog_unreleased/TEMPLATE.md.
  • I’ve read the contributing guidelines.

Try the playground for this PR

@fisker
Copy link
Sponsor Member Author

fisker commented Apr 18, 2020

How do I know it's correct or not? I guess have to check locally.

@thorn0
Copy link
Member

thorn0 commented Apr 18, 2020

How do I know it's correct or not? I guess have to check locally.

One way is to add a test that standalone doesn't have methods like getFileInfo and clearConfigCache.

@fisker
Copy link
Sponsor Member Author

fisker commented Apr 18, 2020

Problem is I don't even know if it's running standalone test.

@thorn0
Copy link
Member

thorn0 commented Apr 18, 2020

Right. So we can add a test that would check that prettier.getFileInfo should be undefined if and only if this env variable is set.

@fisker
Copy link
Sponsor Member Author

fisker commented Apr 18, 2020

But if I set the variable name wrong again, jest will run the default tests, still get pass.

@fisker fisker merged commit 0f3967b into master Apr 18, 2020
@fisker fisker deleted the fisker-patch-1 branch April 18, 2020 18:29
@thorn0
Copy link
Member

thorn0 commented Apr 18, 2020

The default test should assert the opposite: prettier.getFileInfo should be defined.

@thorn0
Copy link
Member

thorn0 commented Apr 19, 2020

Also we could add some kind of report to which each test run would add something (only on CI) and in the end a separate step will check that this report is correct.

thorn0 pushed a commit that referenced this pull request Apr 19, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants