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

Improve test quality #9

Merged
merged 4 commits into from
Dec 13, 2018
Merged

Improve test quality #9

merged 4 commits into from
Dec 13, 2018

Conversation

rmg
Copy link
Member

@rmg rmg commented Dec 13, 2018

This is mainly a backport (and slight re-work) of the tests added in #8 to ensure that the existing functionality and behaviour is adequately tested before such a "large" re-write.

If a source gives us an invalid utf8 sequence, ensure that it is
replaced by a Unicode replacement character as expected.

One of the semver-major changes in node 8 was to change string_decoder
behaviour to better align with the implementation in v8 itself. Now that
we have tests for the handling of incomplete utf8 sequences, this
actually affects us. To account for this, use a simple version check to
determine the expected string output of our bad-utf8 tests.

For background see nodejs/node@24ef1e6775

Signed-off-by: Ryan Graham <r.m.graham@gmail.com>
rmg added 3 commits December 13, 2018 14:50
The original tests were done as a minimal effort approach to fully
exercising the API via the simple CLI wrapper. This approach does not
work on Windows. While everything in this module is completely platform
agnostic, it is better to be certain.

Signed-off-by: Ryan Graham <r.m.graham@gmail.com>
The tests are all written to assume a single LF for newlines. Telling
git about this allows the test fixtures to not get mangled when run on
Windows.

Signed-off-by: Ryan Graham <r.m.graham@gmail.com>
The majority of the uses of strong-log-transformer are for prefixing
console output from multiple processes with a child process identifier
and almost all of them make use of ANSI escape codes in the tags so that
the output is suitably colorful. Since that's a common use, these tests
will ensure that the current behaviour doesn't accidentally change.

Signed-off-by: Ryan Graham <r.m.graham@gmail.com>
@rmg rmg merged commit b7d05fe into master Dec 13, 2018
@rmg rmg deleted the better-testing branch December 13, 2018 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant