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

nothing special #1

Merged
merged 1 commit into from
Mar 7, 2017
Merged

nothing special #1

merged 1 commit into from
Mar 7, 2017

Conversation

annaul
Copy link
Owner

@annaul annaul commented Mar 6, 2017

No description provided.

@annaul annaul merged commit be2b8f2 into master Mar 7, 2017
console.log('\ntoken:', res.text, '\n');
expect(res.status).to.equal(200);
expect(res.text).to.be.a('string');
done();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing an invalid test that should hit your 400 error status.

console.log('\nuser:', this.tempUser);
console.log('\ntoken:', res.text);
expect(res.status).to.equal(200);
done();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also missing an error test here as well.

.then( user => user.save())
.then( user => user.generateToken())
.then( token => res.send(token))
.catch(next);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to hit desired error statuses and messages, you might want to require in your 'http-error' third-party module to customize your error. This will also help with testing your errors, I mentioned below.

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

Successfully merging this pull request may close these issues.

2 participants