mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-13 21:05:22 +00:00
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import { expect, test } from 'vitest';
|
|
import { shouldExcludeProject } from './gitlab';
|
|
import { ProjectSchema } from '@gitbeaker/rest';
|
|
|
|
|
|
test('shouldExcludeProject returns false when the project is not excluded.', () => {
|
|
const project = {
|
|
path_with_namespace: 'test/project',
|
|
} as ProjectSchema;
|
|
|
|
expect(shouldExcludeProject({
|
|
project,
|
|
})).toBe(false);
|
|
});
|
|
|
|
test('shouldExcludeProject returns true when the project is excluded by exclude.archived.', () => {
|
|
const project = {
|
|
path_with_namespace: 'test/project',
|
|
archived: true,
|
|
} as ProjectSchema;
|
|
|
|
expect(shouldExcludeProject({
|
|
project,
|
|
exclude: {
|
|
archived: true,
|
|
}
|
|
})).toBe(true)
|
|
});
|
|
|
|
test('shouldExcludeProject returns true when the project is excluded by exclude.forks.', () => {
|
|
const project = {
|
|
path_with_namespace: 'test/project',
|
|
forked_from_project: {}
|
|
} as unknown as ProjectSchema;
|
|
|
|
expect(shouldExcludeProject({
|
|
project,
|
|
exclude: {
|
|
forks: true,
|
|
}
|
|
})).toBe(true)
|
|
});
|
|
|