-
Notifications
You must be signed in to change notification settings - Fork 1.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
Implement .because() modifier for irregular tests #3227
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This could have an ESLint rule as well, requiring a |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@novemberborn If no one has started working on the implementation, I'd like to take a crack at this. |
Turned out to more complex than I anticipated. But I am still working on this. |
@novemberborn I have made some test and trying to test it. But looks like when I run |
|
I haven't worked on this for a while now. And I am facing troubles setting up the the test, so that the tests use the my changes. If some else has more experience doing I'd like some help, or they can take up the this issue entirely. |
@adiSuper94 , I can take up this issue if you want. In addition, what troubles were you having setting up the tests? |
I think one of the ways to implement this feature is to let the |
@oantoro IIRC that is how the chaining works, the challenge is probably that the "here's the test implementation" is the last step currently, so that needs to change. |
I think additional logic is needed to modify the metadata after the given test is created. |
Based on discussion with @tommy-mitchell in #3224:
Should output:
This requires changes to https://github.com/avajs/ava/blob/main/lib/create-chain.js so that a chainable object is returned for
test.failing()
,test.skip()
etc. Here we then need to add abecause
function. The reason should make its way to the reporter where it can be printed beneath the test title.This should be reflected in the type definitions and documentation. Once we've made some progress on this, work needs to be done with https://github.com/avajs/eslint-plugin-ava to support this new modifier.
It should be a test failure if
because()
is called with anything but a non-empty string.The text was updated successfully, but these errors were encountered: