Skip to content

Commit 039e35e

Browse files
committed
test: add exclude test case
1 parent 98fc749 commit 039e35e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/excludes.test.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const getConfig = require('../src/libs/getConfig')
2+
const config = getConfig()
3+
const { excludes } = config
4+
const reg = new RegExp(excludes.join('|'), 'im')
5+
6+
describe('Test Exclude Regexp', () => {
7+
test('chore: typo', () => {
8+
expect(reg.test('chore: typo')).toBeTruthy()
9+
})
10+
})
11+
12+
describe('Test Exclude Regexp', () => {
13+
test('fix: bbbbbbbbb', () => {
14+
expect(reg.test('fix: bbbbbbbbb')).toBeFalsy()
15+
})
16+
})
17+
18+
describe('Test Exclude Regexp', () => {
19+
test('chore: backup', () => {
20+
expect(reg.test('chore: backup')).toBeTruthy()
21+
})
22+
})
23+
24+
describe('Test Exclude Regexp', () => {
25+
test('chore: save the coding progress', () => {
26+
expect(reg.test('chore: save the coding progress')).toBeTruthy()
27+
})
28+
})

0 commit comments

Comments
 (0)