gitbeaker/test/tests/bundles/ProjectsBundle.ts
jdalrymple 6d5a4b92b0
Typescript Support (#183)
* chore: Introduce typescript 
* chore: Remove lodash.pick, use native js instead
* chore: Add tslint and extend Airbnb ruleset
* chore: Remove Babel Dependency, replace build steps with tsc
* chore: change target for modern env from es2017 to es6 (async/await should be transpiled to downlevel js)
* chore(package): Updating packages
* fix: Fix error while throwing an error in RequestHelper (#156)
* feat: Support rejectUnauthorized parameter (#164)
* feat: Adding project archive abilities
* fix(test): Application settings API updated (#177)
* fix: Removing token requirement (#176)
* chore: Removing npmignore and using files instead.
* fix: obey rate limits for all request types correctly (#170)
* fix: Camel casing broke the body params
2018-09-05 11:22:28 -04:00

59 lines
1.5 KiB
TypeScript

import { ProjectsBundle } from '../../../src';
import * as Services from '../../../src/services';
test('All the correct service keys are included in the projects bundle', async () => {
const bundle = new ProjectsBundle({ token: 'test' });
const services = [
'Branches',
'Commits',
'CommitDiscussions',
'DeployKeys',
'Deployments',
'Environments',
'Issues',
'IssueAwardEmojis',
'IssueNotes',
'IssueDiscussions',
'Jobs',
'Labels',
'MergeRequests',
'MergeRequestAwardEmojis',
'MergeRequestDiscussions',
'MergeRequestNotes',
'Pipelines',
'PipelineSchedules',
'PipelineScheduleVariables',
'Projects',
'ProjectAccessRequests',
'ProjectBadges',
'ProjectCustomAttributes',
'ProjectImportExport',
'ProjectIssueBoards',
'ProjectHooks',
'ProjectMembers',
'ProjectMilestones',
'ProjectSnippets',
'ProjectSnippetNotes',
'ProjectSnippetDiscussions',
'ProjectSnippetAwardEmojis',
'ProtectedBranches',
'ProjectVariables',
'Repositories',
'RepositoryFiles',
'Runners',
'Services',
'Tags',
'Triggers',
];
expect(Object.keys(bundle)).toEqual(expect.arrayContaining(services));
});
test('All the correct service instances are included in the projects bundle', async () => {
const bundle = new ProjectsBundle({ token: 'test' });
Object.keys(bundle).forEach((key) => {
expect(bundle[key]).toBeInstanceOf(Services[key]);
});
});