-
Notifications
You must be signed in to change notification settings - Fork 61
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
Use JsReporters to replace existing adapters #157
Comments
Below is the description of the issues that have appeared by trying to integrate JsReporters, describing each case in the Name: QUnit 1.21.0 Our adapter is working well, but it does not return the real amount of tests, which is 133 and our adapter is returning 132. This is happening, because it exists a test with:
And our adapter is not working well, because it is tokenizing the moduleNames after the character Suggeste solution: update the QUnit adapter in js-reporters to tokenize after Name: Mocha 2.4.5 Problem details:
The problem is with So, Mocha's html reporter displays the tests as passing and then if the done cb is called again will display the same test as a failed test, so we will finish in the output with the same test 2 times. What is pretty weird, by calling also the Mocha's default reporter, and setting its prototype, by counting the tests emitted on "test end", the count is 23, maybe it should be 22 (18 + 4), but how I described above one of the tests is displayed twice and maybe that's why. Suggested solution: The failed test displayed twice is maybe a bug in Mocha's html reporter. In async tests in which the done callback is called more than 1 time will be firstly emitted as passed and then on the second call as failed, this is how Mocha is dealing with that. For example, for Jasmine when the done callback is called the test is emitted and then it does not care if the done callback will be called another time. I think there are 2 options here:
Name: Spine 1.6.2 The Jasmine adapter works and everything is ok. 🎉 Name: Spine 1.0.0 JsReporters has no adapter for Jasmine1. Suggested solution: The Jasmine versions 1.^ are not even available on npm, which denotes that is not popular, I guess it is not used anymore, so I think it is not worth building an adapter for it. If browserstack wants, it could keep the actual one, or drop it. Name: QUnit 1.0.0 (optional repo) Apparently Suggested solution: This version of QUnit is not even available on npm, and how @jzaefferer has suggested:
So there is no reason to bother with this old version and it should be removed from testing. Name: Mocha 1.21.5 For the Suggested solution: update the data in external-tests.js file. |
I don't think that needs further discussion, let's do it.
Afaik QUnit will also somehow fail tests that call
I don't think that's a good idea here, since its not really a bug in our adapter.
Let's just leave the current adapter in place. Unless that makes things a lot more complicated. I agree with the last two as well. |
Not quite, since if it's an adapter for Mocha, we should adapt on how Mocha works, even it is not bug. I will study also QUnit behaviour and I'll be back. |
Okay |
Qunit async control: Qunit will fail a test only if the Example: // Failed test
test('aa', function(assert) {
var done = assert.async();
assert.ok(true);
done();
done();
});
// Passed test
test('aa', function(assert) {
var done = assert.async();
assert.ok(true);
done();
setTimeout(function() {
done();
}, 1000);
}); Mocha would fail both tests. I really don't know, how the standard should be. Any suggestions? I am not also sure, why should a test fail if the EDIT: Also Mocha emits the test twice, one time as passed, the other time as failed, QUnit emits only the failed test. |
That passed test should also fail in QUnit. Can you file an issue against QUnit for that?
A single emit for the failure seems correct to me. |
Yes, it seems fine for me, too. But I don't know how it can be achieved. Let's take the above passing test ( which should be failed), the done callback is called and Qunit thinks everything is ok, this test has passed, but it will not know if the done callback will be called a second time, it would have to wait for an indefinite period of time. If I set the timeout to be after 5 minutes, but after 10 minutes etc. 😕 |
Sure, I will file an issue, but I want to know if this can be achieved to emit the test only one time. |
No idea, I can't think of a solution either. I guess the Mocha behaviour is okay, for something that is a bug in a test... |
Should I still file an issue on the QUnit repo? Maybe after the dicussion with them, it would be more clearer how the standard should be. |
Yes, let's file that issue. |
With JsReporters it is possible to unify all frameworks adapters into one, which would make the code more cleaner and easier to maintain.
As first step would be replacing the existing adapters with the ones from js-reporters, each with a bit of extra code to instantiate the reporter.
For example:
Secondly to abstract that extra code to create a generic registering mechanism so that we can have only one generic reporter for any framework.
What do you think about this?
The text was updated successfully, but these errors were encountered: