Fix CI detection to avoid unwanted TTY behavior#5804
Fix CI detection to avoid unwanted TTY behavior#5804ikatyang merged 9 commits intoprettier:masterfrom kachkaev:fix-ci-detection
Conversation
|
What can we do with the code coverage getting a bit lower? I believe it's because we can't mock |
|
|
|
prettier/tests_integration/runPrettier.js Lines 71 to 73 in 18b03a3 |
|
Ah, didn't know about the issue when bundling |
|
Maybe off-topic but anyway … this seems to be the entire 'use strict'
module.exports = require('ci-info').isCISo … is it better to simply depend on |
|
Won't make a difference, |
|
Yeah, I didn’t mean it would help the tests. I guess I was mostly wondering if anybody else was surprised by the seemingly pointless wrapper package :) |
ikatyang
left a comment
There was a problem hiding this comment.
Could you add a changelog item in CHANGELOG.unrelease.md since the change is visible to users?
|
Thanks for the quick turnaround on this everyone! Just checking to see if this is scheduled for a release soon--we'd love this functionality! Thanks again! |
| })); | ||
| jest | ||
| .spyOn(require(thirdParty), "isCI") | ||
| .mockImplementation(() => process.env.CI); |
There was a problem hiding this comment.
Should this be mocked to a specific value so results are consistent?
There was a problem hiding this comment.
We want to test both CI and non-CI modes and I’m setting env: { CI: true } in a couple of integration tests to make sure the behavior changes.
Fixes #5801
(If changing the API or CLI) I’ve documented the changes I’ve made (in thedocs/directory)CHANGELOG.unreleased.mdfile following the template.