-
Notifications
You must be signed in to change notification settings - Fork 1.4k
test.serial.afterEach #1178
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
Comments
Isn't it incidental that the tests you wish to run some code after are serial to each other? |
I assume currently the For your use case I'd suggest placing the serial tests in a separate file. It's an oddity of how the function chains are managed that you can type that combination. I think it'd be confusing to allow callbacks specifically for serial tests, more so since there is no |
@novemberborn Okay, you're right, that would be confusing. I didn't see it like that yet. It's not really a problem for me, because the afterEach doesn't take long. But it could be a problem, if the afterEach would take 5 seconds or more. Maybe another solution would be to attach the metadata of the associated test to the t-variable. Then you could check there which type of test was/will be (before/after) called. |
Yes, those are potential issues, but easily solved by placing serial tests in separate files. I've opened #1182 so that eventually we'd remove support for |
It would be great if I could do this:
I want to run a test-file where some tests are serial to test functions which require a database and some tests should run in parallel. I would like to clear the database after each of the serial tests, but the others don't need it.
The text was updated successfully, but these errors were encountered: