Skip to content

Commit 8414a55

Browse files
authored
Convert tests to TypeScript (#346)
* Write tests in TypeScript * Fix test linting
1 parent 04362bb commit 8414a55

21 files changed

+412
-223
lines changed

.eslintrc.cjs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
root: true,
23
extends: [
34
'eslint:recommended',
45
'plugin:@typescript-eslint/recommended-type-checked',
@@ -9,5 +10,19 @@ module.exports = {
910
project: true,
1011
tsconfigRootDir: __dirname,
1112
},
12-
root: true,
13+
overrides: [
14+
{
15+
files: ['test/**/*.ts'],
16+
extends: [
17+
'eslint:recommended',
18+
'plugin:@typescript-eslint/recommended-type-checked',
19+
],
20+
plugins: ['@typescript-eslint'],
21+
parser: '@typescript-eslint/parser',
22+
parserOptions: {
23+
project: './test/tsconfig.json',
24+
tsconfigRootDir: __dirname,
25+
},
26+
},
27+
],
1328
};

jest.config.cjs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
module.exports = {
3+
preset: 'ts-jest',
4+
testEnvironment: 'node',
5+
transform: {
6+
'^.+\\.tsx?$': [
7+
'ts-jest',
8+
{
9+
tsconfig: 'test/tsconfig.json',
10+
},
11+
],
12+
},
13+
coverageThreshold: {
14+
global: {
15+
branches: 50,
16+
functions: 50,
17+
lines: 50,
18+
statements: 50,
19+
},
20+
},
21+
};

jest.config.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)