Closed spenserblack closed 11 months ago
Oh, interesting. The CI environment didn't detect truecolor support by default, causing the snapshot tests to fail. I updated the env
key in the test workflow to force true color. Perhaps there should be some sort of togglable value, even if it's internal, so that this can be forced inside tests instead of leaving it up to the environment.
As discussed in #156, this converts the visual tests into things that can be asserted with
cargo test
. These can still be visually reviewed withcat path/to/snapshot
. This also registers the detected language for*.snap
files as plain text -- currently, GitHub will detect them as Jest snapshot files and apply a JavaScript-like syntax highlighting otherwise. This also installscargo-insta
when a contributor creates a new codespace.The one
println!
in a test that I didn't address is here https://github.com/colored-rs/colored/blob/682adf8050f7566b4cef125515c1248c8e55736b/src/lib.rs#L839Since that didn't look like part of the test, but just a snippet to help debug. I was tempted to switch it to a
dbg!
call, butdbg!
prints theDebug
formatting instead of the display formatting.