Skip to content

Instantly share code, notes, and snippets.

@Fiyiin
Last active March 21, 2019 08:19
Show Gist options
  • Save Fiyiin/b59b7c1b05bd16a4a9846c9209511091 to your computer and use it in GitHub Desktop.
Save Fiyiin/b59b7c1b05bd16a4a9846c9209511091 to your computer and use it in GitHub Desktop.
A gist to demo tests to unfollow a user on Author's Haven
import request from 'supertest';
import expect from 'expect';
import app from '../app';
describe('To Unfollow a User ', () => {
it('should return the user profile object', (done) => {
request(app)
.delete('/api/profiles/jake/follow')
.set('Authorization', 'JWT')
.expect('Content-Type', /json/)
.expect(200)
.expect((res) => {
expect(res.body).toEqual(
{
"profile": {
"username": "jake",
"bio": "I work at statefarm",
"image": "image-link",
"following": false
}
}
);
})
.end(done)
})
});
@kayroy247
Copy link

You have done a good job by paying attention to details of the specification but I think you terminated line 24 with a semicolon and still want to chain it to.end() method.
Secondly, you may need to make your indentation consistent on line 26.

@Fiyiin
Copy link
Author

Fiyiin commented Mar 21, 2019

@kayroy247 thanks. Fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment