-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Description
I'm using ava to write tests that involve lots of ANSI codes, and the test output gets unwieldy. I'm surprised, actually, since ava is used to test chalk, I would think this would've come up before.
Anyway, ansi in this screenshot contains \x1b[31;41m and the output looks like this:
I narrowed down the search to assert.js
function formatDescriptorDiff(actualDescriptor, expectedDescriptor, options) {
options = { ...options, ...concordanceOptions };
const { diffGutters } = options.theme;
const { insertLine, deleteLine } = options.theme.string.diff;
// here
const formatted = concordance.diffDescriptors(
actualDescriptor,
expectedDescriptor,
options,
);
return {
label: `Difference (${diffGutters.actual}${deleteLine.open}actual${deleteLine.close}, ${diffGutters.expected}${insertLine.open}expected${insertLine.close}):`,
formatted,
};
}options contains all the colorization, which makes sense. What I couldn't find was an option in concordance that would let me escape the input.