Last active
March 21, 2019 08:19
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.