-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
feat(cli): Adding JUnit test reports #19747
Conversation
09bec2d
to
5bd7fcb
Compare
f9ffcf3
to
4b32798
Compare
This PR breaks the addition of the `TestReporter` trait and refactoring of `PrettyTestReporter` out of #19747. The goal is to enable the addition of test reporters, including machine readable output.
7845283
to
f09f2c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good to me!
Adding unit test for flag
7cf41ff
to
e499c2e
Compare
@skycoop I did this:
Then I used
Then I opened the file in the browser and got this: Looks great, test steps are reported too - although in a bit quirky way... here's how it looks if there's a failing step: I did a quick comparison with what var assert = require('assert');
describe('Array2', function () {
describe('#indexOf()', function () {
it('should return -1 when the value is not present', function () {
assert.equal([1, 2, 3].indexOf(4), -1);
});
it('should return -1 when the value is not present', function () {
assert.equal([1, 2, 3].indexOf(2), 1);
});
for (var i = 0; i < 10; i++) {
it(`generated ${i}`, function () {
assert(false);
});
}
});
}); It appears Do you feel it would be possible for us to do the same for our test steps? (Seems like the exact same problem we'd have to face if we decided to do #14390, so might be worth to address it now). |
I think the representation is being unpacked that way since The issue comparing with mocha is that our internal representation is different. |
Pulled from #19747 Authored-by: Cooper Benson <skycoop@gmail.com>
Pulled from #19747 Authored-by: Cooper Benson <skycoop@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR makes the following changes
CompoundTestReporter
to allow us to use multiple reportersJUnitTestReporter
which writes JUnit XML to a path--junit
that enables JUnit reporting. By default this writes the report tostdout
(and disables pretty reporting). If a path is provided, it will write the JUnit report to that file while the pretty reporter writes to stdout like normalOutput of
deno -- test --allow-all --unstable --location=http://js-unit-tests/foo/bar --junit cli/tests/unit/testing_test.ts