summaryrefslogtreecommitdiff
path: root/source/github-helpers/bugs-label.test.ts
blob: e5ab0bd951a3ce0982d7a5655e22e6ffbc1a45fe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import {assert, test} from 'vitest';

import isBugLabel from './bugs-label.js';

const supportedLabels = `
bug
bug-fix
bugfix
confirmed-bug
type/bug
type:bug
kind/bug
kind:bug
triage/bug
triage:bug
:bug:bug
:bug: bug
🐛bug
🐛 bug
`;

const blockedLabels = `
bugfixes
bugtracker
bug-report
bug-hunt
bugzilla
debug
bugatti
ladybug
`;

test('isBugLabel', () => {
	for (const label of supportedLabels.trim().split('\n')) {
		assert.isTrue(isBugLabel(label), label + ' is a bug label');
	}

	for (const label of blockedLabels.trim().split('\n')) {
		assert.isFalse(isBugLabel(label), label + ' is a not bug label');
	}
});