-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Stabilize colors #1524
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
Stabilize colors #1524
Conversation
Prior to this commit, the library and its tests relied on the same code to add color to terminal output. This prevented the tests from recognizing changes to that code. Such a change was introduced in a recent release of the `chalk` module [1]: it was updated to disable text coloring when run without a TTY. This is the case in the test environment environment provided by the `tap` module (which Ava uses for its tests). This fix disabled color output in the tests, but it caused no failures because both the expected values and the actual values were effected. However, this situation amounted to a decrease in test coverage because the expected color of the terminal output could no longer be verified. Update the tests environment to simulate a TTY so that Ava continues to produce colored text despite being run in a sub-process provided by `tap`. Update the test logic to reduce dependency on Ava internals in order to avoid similar silent regressions in the future. [1] chalk/chalk@0827d3b
This is odd. The I'm perpetually confused by color management in AVA, and this PR seems appropriate despite my questions in the previous paragraph. Still, I'd like to understand it all a bit better before hitting the merge button. (And, as it stands, there are some linting errors.) |
I think I'd call it a bug fix because as I understand it, it disables colors With the linting problem out of the way, I can see some Windows-specific test |
Makes sense, thanks @jugglinmike! |
My pleasure! |
Stabilize colors
This issue was a surprise for me after first submitting gh-1508 because I had been using npm version 3. That version does not recognize the
package_lock.json
file, so I had been vetting my changes with newer versions of the module dependencies than are available in the continuous integration environment (this is why the tests pass for the build that setsFRESH_DEPS
totrue
).