import * as chai from 'chai'; import * as chaiAsPromised from 'chai-as-promised'; import { request, response } from '../../data/billing_data'; chai.use(chaiAsPromised); const rewire = require('rewire'); const expect = chai.expect; const billingRoute = rewire('../../../api/billing'); describe('Billing', () => { describe('getAll', () => { const getAlls = billingRoute.__get__('getAll'); it('reject if the request paramaters are invalid', async () => { await expect(getAlls({}, {})).to.be.rejected; }); it('process request if the request paramaters are valid', async () => { await expect(getAlls(request, response)).to.not.be.rejected; }); }); });