Skip to content

Instantly share code, notes, and snippets.

@jackfiallos
Created August 22, 2018 18:48
Show Gist options
  • Select an option

  • Save jackfiallos/5460c386e857754f6528e9841194f92f to your computer and use it in GitHub Desktop.

Select an option

Save jackfiallos/5460c386e857754f6528e9841194f92f to your computer and use it in GitHub Desktop.
//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