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

Test suite #32

Closed
paulirish opened this issue Feb 10, 2016 · 3 comments · Fixed by #53
Closed

Test suite #32

paulirish opened this issue Feb 10, 2016 · 3 comments · Fixed by #53

Comments

@paulirish
Copy link
Member

I think it's time for us to add proper unit tests.

I haven't seen a test suite for a project like this before, but it shouldnt be too bad. I'm thinking a folder of input text files, with ANSI escapes and all. And a folder of expected output. Seem right?

Is there a test runner that'd work well for us?

@stevemao
Copy link
Member

👍 , too hard to test manually!

@paulirish
Copy link
Member Author

Ah, I now remember https://github.com/sstephenson/bats This seems close to ideal. :)

@paulirish
Copy link
Member Author

I attempted to get this going, but it's a bit tougher than expected.

For anyone curious, this points to the most mature assertion set for use with bats: sstephenson/bats#110 (comment)

I believe that Bats struggles with the combination of multiline output, ansi colors and empty newlines. As such, I haven't been able to target specific lines in the output, only just fuzzy partial matches against the whole thing.

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

Successfully merging a pull request may close this issue.

2 participants