atsid/generator-ats-node-webapp

View on GitHub
generators/server-full/templates/server/middleware/root/root.spec.js

Summary

Maintainability
A
2 hrs
Test Coverage
const {expect} = require('chai');
const root = require('./index');

describe('The Root Middleware', () => {
  it('can emit the service status', (done) => {
    let sentJson = false;
    const res = {
      json: (data) => {
        sentJson = true;
        expect(data.status).to.equal('ok');
      },
      end: () => {
        expect(sentJson).to.be.true;
        done();
      },
    };
    root.get({}, res);
  });
});