Skip to content

Instantly share code, notes, and snippets.

@michaelerobertsjr
Created August 28, 2018 21:31
Show Gist options
  • Save michaelerobertsjr/f1737c6b0a308d5d90cb0a71a7737258 to your computer and use it in GitHub Desktop.
Save michaelerobertsjr/f1737c6b0a308d5d90cb0a71a7737258 to your computer and use it in GitHub Desktop.
test a loopback model and server
const chai = require('chai');
const chaiHttp = require('chai-http');
const app = require('../../server/server');
const expect = chai.expect;
chai.use(chaiHttp);
describe('Server app', function mocha() {
this.timeout(6500);
it('Text model should exist', () =>
expect(app.models.Text).to.exist
);
it('GET / responds with a 200 response code', () =>
chai.request(app)
.get('/')
.then((res) => {
expect(res).to.have.status(200);
})
);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment