Skip to content

Commit 1d4cf67

Browse files
committed
jest configuration
1 parent 17d88e7 commit 1d4cf67

File tree

5 files changed

+8775
-2378
lines changed

5 files changed

+8775
-2378
lines changed

__tests__/soma.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import soma from '../src';
2+
3+
test('it should add', () => {
4+
expect(soma(1, 2)).toBe(3);
5+
});

jest.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
2+
module.exports = {
3+
preset: 'ts-jest',
4+
testEnvironment: 'node',
5+
clearMocks: true,
6+
globals: {
7+
'ts-jest': {
8+
useESM: true,
9+
},
10+
},
11+
moduleNameMapper: {
12+
'^(\\.{1,2}/.*)\\.js$': '$1',
13+
},
14+
extensionsToTreatAsEsm: ['.ts'],
15+
collectCoverage: true,
16+
collectCoverageFrom: ['src/**/*.{ts,tsx}'],
17+
coverageThreshold: {
18+
global: {
19+
branches: 100,
20+
functions: 100,
21+
lines: 80,
22+
statements: 100,
23+
},
24+
},
25+
};

0 commit comments

Comments
 (0)