mirror of
https://github.com/jdalrymple/gitbeaker.git
synced 2026-01-18 15:55:30 +00:00
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { Issues, Projects } from '../../../src';
|
|
|
|
const { TEST_ID } = process.env;
|
|
let issueAPI: InstanceType<typeof Issues>;
|
|
let projectAPI: InstanceType<typeof Projects>;
|
|
|
|
beforeAll(async () => {
|
|
issueAPI = new Issues({
|
|
host: process.env.GITLAB_URL,
|
|
token: process.env.PERSONAL_ACCESS_TOKEN,
|
|
});
|
|
projectAPI = new Projects({
|
|
host: process.env.GITLAB_URL,
|
|
token: process.env.PERSONAL_ACCESS_TOKEN,
|
|
});
|
|
});
|
|
|
|
describe.skip('Issues.all', () => {
|
|
beforeAll(async () => {
|
|
const project = await projectAPI.create({ name: `Issues All Integration Test ${TEST_ID}` });
|
|
const newIssues: any[] = [];
|
|
|
|
for (let i = 0; i < 100; i += 1) {
|
|
newIssues.push(
|
|
issueAPI.create(project.id as number, {
|
|
title: `Issue.all Test ${i}`,
|
|
description: 'A test issue',
|
|
}),
|
|
);
|
|
}
|
|
|
|
await Promise.all(newIssues);
|
|
});
|
|
|
|
it('should get 60 projects using keyset pagination', async () => {
|
|
const projects = await issueAPI.all({ maxPages: 3, pagination: 'keyset' });
|
|
|
|
expect(projects).toBeInstanceOf(Array);
|
|
expect(projects).toHaveLength(60);
|
|
});
|
|
});
|