Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

works with express generator

process.env.NODE_ENV = 'test';
 

let chai = require('chai');
let chaiHttp = require('chai-http');
let server = require('../app');
let should = chai.should();


chai.use(chaiHttp);

 
  describe('/GET book', () => {
      it('it should GET all the books', (done) => {
            chai.request(server)
            .get('/first')
            .end((err, res) => {
                  res.should.have.status(200);
              
              done();
            });
      });
  }); 
Source by www.npmjs.com #
 
PREVIOUS NEXT
Tagged: #works #express #generator
ADD COMMENT
Topic
Name
7+6 =