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

tape output diffs / linebreak #294

Open
fab1an opened this issue Jun 18, 2016 · 3 comments
Open

tape output diffs / linebreak #294

fab1an opened this issue Jun 18, 2016 · 3 comments

Comments

@fab1an
Copy link

fab1an commented Jun 18, 2016

I use tape to test a source-generator so I often have larger files to compare.

Tape shows me the output with linebreaks escaped as '\n', which is difficult to read. Is there a way I could have a line-by-line diff. Or compare two arrays and have tape tell me which elements differ?

@fab1an fab1an closed this as completed Dec 30, 2017
@ljharb
Copy link
Collaborator

ljharb commented Dec 30, 2017

Improving the failure output seems like it's still a useful feature request, this should remain open.

@thewilkybarkid
Copy link

thewilkybarkid commented Jun 29, 2021

I've just been running into the same problem: tape has been working really well, except for the fact that failures on the multiline strings I'm trying to assert on are pretty unreadable:

image

Looks like this happens with the use of inspect-object:

https://github.com/substack/tape/blob/021fa6d22bc85f2e8f075405bcb97c6a1b87af22/lib/results.js#L174-L175

Would it make sense to skip this if it's already a string? Line breaks would then be present, but you'd lose the single quotes surrounding it (does that qualify as a breaking change?).

@ljharb
Copy link
Collaborator

ljharb commented Jun 29, 2021

@thewilkybarkid the surrounding quotes are important. It seems reasonable for tape to maybe take an option, and pass an option to object-inspect (and add the option there if needed) to improve the formatting here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants