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

Callback being called multiple times in failing controller tests #327

Open
agilekevin opened this issue Mar 29, 2017 · 0 comments
Open

Callback being called multiple times in failing controller tests #327

agilekevin opened this issue Mar 29, 2017 · 0 comments

Comments

@agilekevin
Copy link

In several of my tests for at least two different controllers, the callback provided to post is called many times if the test fails.

The console log below appears four times. The first one has a value and the next three are null. The first comparison to 200 fails. If I remove the assertions, the console log appears only once.

this.endpoint('/v1/users/').post( {"email":"foobar@gmail.com","username":"foobar","password":"foobar"}, (status, headers, body, json) => { console.log("[ JSON ]: ", json); expect(status).to.equal(200, JSON.stringify( json )); expect(json.meta.count).to.equal(1); done(); }

I don't see this behavior for another test that only does get requests.

I put in some console logs, and I can see that the endpoint_request.mock is only called once, but the result of the router.prepare and router.dispatch is that the callback is called four times.

I thought it might be a problem in my router.js, but it's pretty vanilla.

Is there some kind of retry logic happening here? Not sure where to look next.

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