Last active
June 15, 2020 12:10
-
-
Save kianaditya/b3a577cd8f14fffcc2a36c1c3aac98a6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//posts.spec.js | |
const request = require('supertest') | |
const app = require('../src/app') // the express server | |
const expect = require('chai').expect | |
describe('GET /posts endpoint', () => { | |
it('GET /posts endpoint successfully returns response', () => { | |
return request(app) | |
.get('/posts') | |
.then((response) => { | |
expect(response.statusCode).to.equal(200) | |
expect(response.text).to.equal('You have hit GET /posts endpoint') | |
}) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment