-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add reporting hooks that conform to js-reporters #15
Comments
Hi, I am currently taking care of the I am not sure how the
can be represented for teenytest. I was thinking all For example: module.exports = {
test1: function() {},
...
testn: function() {}
} all this type of tests, that we call global tests, should be part, only theoretically, of a module.exports = {
suite1: {
test1: function() {},
...
testn: function() {}
},
suite2: {
suite21 {
test1: function() {},
...
testn: function() {}
},
test1: function() {},
...
testn: function() {}
}
...
suiten: {
...
}
} So only nested tests will really contain suites. |
Please bear in mind I'm not familiar with the js-reporter spec yet other than a cursory review. A few pieces of background:
As a result, I would define this as a global teenytest suite: // $ teenytest **/*.test.js
// foo.test.js
module.exports = {
test1: function(){},
sub: {
test2: function(){}
}
}
// bar.test.js
module.exports = function test3 () {}
Conceptually, this seems pretty solid to me. Could you explain the nature of the issue with this? Is this just a case the spec didn't consider? |
Sure, neither do I with teenytest 😄 I was talking about that The above definition of the global suite is perfect, the global suite must contain all the tests and groups of tests (suites). This suite must be emitted on the I am not sure about the
this would be done in js-reporters hooks:
Maybe some people will get confused if they see an extra suite in the reporter's output that they have not defined. Also now teenytest does not ouput a test name composed with the file name, for the test in |
@flore77 big news—I've been busy making teenytest more extensible, in part inspired by this discussion. I just released [email protected] which has a plugin architecture that may allow for a relatively painless implementation of a js-reporters compliant reporter plugin to be created (whether it's published separately or shipped as part of the main repo) |
Great! Indeed, you have done a lot of work. I will look over and try to write a |
@searls it is not quite I was expecting. I was thinking to implement the js-reporter spec native into teenytest. So that teenytest could be connected to any reporter that is respecting the standard. The goal is that for example That's why I am thinking it would be good for teenytest to have it built in, it would work out of the box with high-level consumers like Karma, BrowserStack, SauceLabs etc. What do you think about it? |
Without having reviewed the plugin architecture, so maybe I'm missing something important there: To expand on what @flore77 said, we were hoping that the plugin interface of teenytest would use the event emitter specced in js-reporters, using the same events and properties. That way js-reporters compatible reporters would work immediately, instead of having to implement teenytest specific plugins for each reporter format. |
@jzaefferer understood, but the plugin system I needed required far more granularity (and an ability to mutate outcomes) that the js-reporter spec itself wouldn't allow. Since js-reporter is, I think, a pretty easy-to-circumscribe subset of what this plugin design will allow, whether the plugin is shipped internally and enabled by default or shipped externally and a prerequisite for other js-reporter pluggability would, I think, be a social decision we could make. |
If you guys aren't feeling sure about an approach here, I'm happy to take a stab as a POC. In order to proceed, though, I need some idea on how a js-reporters compliant test runner would be configured? Does someone register to an EventEmitter? If so, we could use a teenytest configurator and Want to check on that before I proceed because it feels like more often than not the communication will need to be interprocess and I'm not sure how to deal with that
|
That looks pretty reasonable. We're currently working on integrating js-reporters into browserstack-runner, and should have a reference implementation there soon. Once that is in place, we could extend that to also support teenytest (once it has native support for js-reporters). That would be an even better reference implementation.
The main reason we held back on responding here was this comment. Both @flore77 and me weren't clear what the usecase would be. Do you have an example that could clarify the issue? |
@searls a little update, here is the integration into browserstack-runner. If teenytest would come with the js-reporter spec natively it would work directly with the new |
Very cool. Implementing js-reporter as an EventEmitter using the |
One half of our extensibility story is getting information out of the tests as they run (or afterward). It'd be nice if we had this, and we may as well implement it to the emerging spec since it's greenfield and there's no reason not to: https://github.com/js-reporters/js-reporters
The text was updated successfully, but these errors were encountered: