Skip to content

Commit 0ed32ea

Browse files
committed
test: add author test case
1 parent 039e35e commit 0ed32ea

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/authors.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 { authors } = config
4+
const reg = new RegExp(authors.join('|'), 'im')
5+
6+
describe('Test Author Regexp', () => {
7+
test('chengpeiquan', () => {
8+
expect(reg.test('chengpeiquan')).toBeTruthy()
9+
})
10+
})
11+
12+
describe('Test Author Regexp', () => {
13+
test('ChengPeiQuan', () => {
14+
expect(reg.test('ChengPeiQuan')).toBeTruthy()
15+
})
16+
})
17+
18+
describe('Test Author Regexp', () => {
19+
test('peiquan', () => {
20+
expect(reg.test('peiquan')).toBeFalsy()
21+
})
22+
})
23+
24+
describe('Test Author Regexp', () => {
25+
test('petter', () => {
26+
expect(reg.test('petter')).toBeFalsy()
27+
})
28+
})

0 commit comments

Comments
 (0)