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
Un-deprecate the "suite" event #4760
Comments
Afaik the |
It is according to the API docs. Event |
Hello. I want too use event 'suite' without deprecation warnings. Moreover I need other deprecated events. For example in our tool we does not add ability to users use The problem is here - https://github.com/mochajs/mocha/blob/master/lib/suite.js#L686-L693. |
@beatfactor All those
You are talking about "suite is execute", so the execution cycle (not parsing cycle). Couldn't you listen to the |
@juergba No, I am actually talking about the parsing cycle as well, even before the test suite is execute. Listening to the runner events doesn't help because we need to be able to extend the test suite before it's being executed. The It's up to you and your team of course to decide if you're going to keep it or not but for us it is very helpful and if it's removed from future versions that means that we will have to probably work with a fork of Mocha, which is fine but not ideal, since it will inevitably be always behind the latest version. |
@beatfactor Can you explain Could you open a PR, please? All in lib/suite.js.
|
In Nightwatch we have a bunch of custom stuff added to the describe interface. You can do things like defining tags for instance: describe('homepage test with describe', function() {
// defining tags using bdd
this.tags = ['login', 'authentication''];
test('...', function() {...});
}); You can see more about it here. This is in our own version of the describe interface, which has been added since v1.3 but you can also use Mocha as a test runner since v0.9. However, the bundled version of Mocha in Nightwatch is based on Mocha 6 and also it lacks the ability to use tags and other Nightwatch-related things, which you can do in our own version of the describe interface. But since Nightwatch v2 we are upgrading our bundled version of the Mocha runner to be based on Mocha 9 and so we need to be able to extend the test suite in one way or another. Listening to the test suite add event proved to be the most straightforward way to do that. Sure, I will go ahead and send a PR soon. Thanks! |
Which test runner are you using with your own I don't know wether those |
Our own test runner. I have looked into adding an extra interface but we actually want users to be able to set their own interface when using the Mocha runner so this won't work. We also need to extend the Mocha runner itself and adapt the runnables. If you're interested, the whole thing will be online in a few days and if you'd like you can have a look at it. |
@juergba thanks for merging the PR. Do you have an indication on when it's going to be in NPM? |
@beatfactor In 7-10 days latest, I first need another (browser) issue fixed. |
Hi there,
We are using Mocha as an alternative test runner in Nightwatch.js and we are in the process of migrating it to use Mocha 9. I noticed that the 'suite' event is deprecated and it would be great if you would consider un-deprecating it. This is the only clean way for us to start the Nightwatch session before the Mocha suite is execute and without it we'd have to result to inefficient and complicated workarounds.
Thanks!
The text was updated successfully, but these errors were encountered: