Fix & Add unit tests.

This commit is contained in:
kialam
2019-01-15 14:58:23 -05:00
parent 215c23609c
commit e8fe6fe33c
5 changed files with 85 additions and 28 deletions

View File

@@ -126,4 +126,16 @@ describe('APIClient (api.js)', () => {
done();
});
test('getInstanceGroups calls expected http method', async (done) => {
const createPromise = () => Promise.resolve();
const mockHttp = ({ get: jest.fn(createPromise) });
const api = new APIClient(mockHttp);
await api.getInstanceGroups();
expect(mockHttp.get).toHaveBeenCalledTimes(1);
done();
});
});