Skip to content

Commit fbf6af4

Browse files
committed
test(rules): ignore types file and use ts extension
1 parent a6da04e commit fbf6af4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

@commitlint/rules/src/index.test.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import values from 'lodash/values';
44
import rules from '.';
55

66
test('exports all rules', async () => {
7-
const expected = (await glob('*.js')).sort();
7+
const expected = (await glob('*.ts')).sort();
88
const actual = Object.keys(rules).sort();
99
expect(actual).toEqual(expected);
1010
});
@@ -14,18 +14,18 @@ test('rules export functions', () => {
1414
expect(actual.every(rule => typeof rule === 'function')).toBe(true);
1515
});
1616

17-
async function glob(pattern) {
17+
async function glob(pattern: string | string[]) {
1818
const files = await globby(pattern, {
19-
ignore: ['**/index.js', '**/*.test.js'],
19+
ignore: ['**/index.ts', '**/*.test.ts', '**/types.ts'],
2020
cwd: __dirname
2121
});
2222
return files.map(relative).map(toExport);
2323
}
2424

25-
function relative(filePath) {
25+
function relative(filePath: string) {
2626
return path.relative(__dirname, filePath);
2727
}
2828

29-
function toExport(fileName) {
29+
function toExport(fileName: string) {
3030
return path.basename(fileName, path.extname(fileName));
3131
}

0 commit comments

Comments
 (0)