Skip to content

Instantly share code, notes, and snippets.

@mulatinho
Created November 4, 2017 21:22
Show Gist options
  • Save mulatinho/0a75ab1bb596383ef817ca3a862857b0 to your computer and use it in GitHub Desktop.
Save mulatinho/0a75ab1bb596383ef817ca3a862857b0 to your computer and use it in GitHub Desktop.
test-chai.js
var app = require('../main.js');
var request = require('supertest');
var chai = require("chai");
describe('A list of tests', function() {
describe('#GET /questions', function() {
it('should get a list of questions', function(done) {
request(app) .get('/questions')
.end(function(err, res) {
expect(res.statusCode).to.equal(200);
expect(res.body).to.be.an('array');
expect(res.body).to.be.empty;
done();
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment