/* eslint-disable */
const chai = require('chai');
const chaiHttp = require('chai-http');
const server = require('../src/server').server;
const knex = require('../src/db/db.js');

const should = chai.should();

chai.use(chaiHttp);

describe('API', () => {

  beforeEach((done) => {
    knex.migrate.rollback()
      .then(() => knex.migrate.latest())
      .then(() => knex.seed.run())
      .then(() => done());
  });

  afterEach(function (done) {
    knex.migrate.rollback()
      .then(() => done());
  });

  describe('GET /', () => {
    it('should return index', (done) => {
      chai.request(server)
        .get('/')
        .end((err, res) => {
          res.should.have.status(200);
          res.should.be.html;
          done();
        });
    });
  });

  describe('GET /scam', () => {
    it('should return page not found', (done) => {
      chai.request(server)
        .get('/scam')
        .end((err, res) => {
          res.should.have.status(404);
          res.should.be.html;
          done();
        });
    });
  });

  describe('GET /example', () => {
    it('should return example', (done) => {
      chai.request(server)
        .get('/example')
        .end((err, res) => {
          res.should.have.status(200);
          res.should.be.json;
          res.body.should.be.a('array');
          res.body.length.should.equal(4);
          res.body[0].should.have.property('id');
          res.body[0].should.have.property('column_1');
          res.body[0].column_1.should.equal('value1');
          res.body[0].should.have.property('column_2');
          res.body[0].column_2.should.equal(1);
          done();
        });
    });
  });
});
/* eslint-enable */

@@ -1268,32 +1268,35 @@
 .json;%0A         
+ //
  res.body.should
@@ -1312,32 +1312,35 @@
 ray');%0A         
+ //
  res.body.length
@@ -1358,32 +1358,35 @@
 al(4);%0A         
+ //
  res.body%5B0%5D.sho
@@ -1411,32 +1411,35 @@
 'id');%0A         
+ //
  res.body%5B0%5D.sho
@@ -1470,32 +1470,35 @@
 n_1');%0A         
+ //
  res.body%5B0%5D.col
@@ -1528,32 +1528,35 @@
 ue1');%0A         
+ //
  res.body%5B0%5D.sho
@@ -1591,24 +1591,27 @@
 );%0A         
+ //
  res.body%5B0%5D

Test fixes