Created
August 22, 2018 18:48
-
-
Save jackfiallos/5460c386e857754f6528e9841194f92f 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
| //During the test the env variable is set to test | |
| process.env.NODE_ENV = 'test'; | |
| //Require the dev-dependencies | |
| const chai = require('chai'); | |
| const chaiHttp = require('chai-http'); | |
| const serverUrl = 'http://localhost:3000'; | |
| const expect = chai.expect; | |
| chai.use(chaiHttp); | |
| // Our parent block | |
| describe('Home', () => { | |
| describe('GET /', () => { | |
| it('home', done => { | |
| chai | |
| .request(serverUrl) | |
| .get('/') | |
| .end((err, res) => { | |
| expect(res).to.have.status(403); | |
| expect(res).to.be.json; | |
| done(); | |
| }); | |
| }); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment