mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-25 16:04:01 +00:00
- Exports all types - Clean up type duplicates - Remove Project,User and Group Bundles - Fix typing on the Gitlab Export - Clean up README.md
32 lines
797 B
TypeScript
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', {});
|
|
});
|
|
});
|