Skip to content
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

Removing previous test expectations #18

Open
givan opened this issue Feb 27, 2014 · 1 comment
Open

Removing previous test expectations #18

givan opened this issue Feb 27, 2014 · 1 comment

Comments

@givan
Copy link

givan commented Feb 27, 2014

I'm using one gently instance per .js test file. The test file has multiple tests each setting expectations. However, if say the 3rd test out of 10 fails, and that test had few unmet expectations, these expectations fail the remaining tests (from 4th to 10th) because all of them are having the expectations from the failed 3rd. Is there any way to reset the expectations before each test run?

@givan
Copy link
Author

givan commented Feb 27, 2014

A temporary work-around i found so far is to use gently.verify() at the beginning of each test to make sure there are no unmet expectations:

gently.verify('There are unmatched expectations from previous test. ' + 
                'Possible failure from that will cause this test to fail. Fix first the previous test!');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant