Created
February 1, 2019 13:40
-
-
Save Mcdavid95/ad0807ff02a2ff4f8489bc508856b756 to your computer and use it in GitHub Desktop.
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
const supertest = require('supertest'); | |
const server = require('./index'); | |
const chai = require('chai'); | |
chai.should(); | |
const api = supertest.agent(server); | |
describe('Add method', () => { | |
it('should connect to the Server', (done) => { | |
api.post('/api/add') | |
.set('Connetion', 'keep alive') | |
.set('Content-Type', 'application/json') | |
.type('form') | |
.send({ | |
firstNumber: 2, | |
secondNumber: 3 | |
}) | |
.end((err, res) => { | |
res.status.should.equal(200); | |
res.body.result.should.equal(5); | |
done(); | |
}); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment