Justin Dalrymple 6a3292b033
Expose typing to consumer and remove export complexity (#1818)
- Exports all types
- Clean up type duplicates
- Remove Project,User and Group Bundles
- Fix typing on the Gitlab Export
- Clean up README.md
2021-07-05 15:34:19 -04:00

32 lines
797 B
TypeScript

import { Events } from '../../../src';
import { RequestHelper } from '../../../src/infrastructure';
jest.mock(
'../../../src/infrastructure/RequestHelper',
() => require('../../__mocks__/RequestHelper').default,
);
let service: Events;
beforeEach(() => {
service = new Events({
requesterFn: jest.fn(),
token: 'abcdefg',
requestTimeout: 3000,
});
});
describe('Events.all', () => {
it('should request GET /projects/:id/events', async () => {
await service.all({ projectId: 12 });
expect(RequestHelper.get()).toHaveBeenCalledWith(service, 'projects/12/events', {});
});
it('should request GET /projects/:id/events without options', async () => {
await service.all();
expect(RequestHelper.get()).toHaveBeenCalledWith(service, 'events', {});
});
});