Skip to content

Commit b3e826b

Browse files
niktverdNikolay Tverdokhlebov
andauthored
Feat/tests (#98)
feat: tests added Co-authored-by: Nikolay Tverdokhlebov <[email protected]>
1 parent 8d7f1ab commit b3e826b

File tree

10 files changed

+15914
-10076
lines changed

10 files changed

+15914
-10076
lines changed

.eslintrc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
{
22
"extends": ["@gravity-ui/eslint-config", "@gravity-ui/eslint-config/prettier"],
3-
"root": true
3+
"root": true,
4+
"env": {
5+
"node": true,
6+
"jest": true
7+
},
8+
"overrides": [
9+
{
10+
"files": ["**/__tests__/**/*.[jt]s?(x)", "**/?(*.)+(spec|test).[jt]s?(x)"],
11+
"extends": ["plugin:testing-library/react"]
12+
},
13+
{
14+
"files": ["**/__stories__/**/*.[jt]s?(x)"],
15+
"rules": {
16+
"no-console": "off"
17+
}
18+
}
19+
]
420
}

jest.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = {
2+
verbose: true,
3+
moduleFileExtensions: ['js', 'json', 'ts', 'tsx'],
4+
rootDir: '.',
5+
transform: {
6+
'^.+\\.[jt]sx?$': 'ts-jest',
7+
},
8+
transformIgnorePatterns: ['node_modules/(?!(@gravity-ui)/)'],
9+
coverageDirectory: './coverage',
10+
collectCoverageFrom: [
11+
'src/blocks/**/*.{ts,tsx,js,jsx}',
12+
'src/components/**/*.{ts,tsx,js,jsx}',
13+
'src/containers/**/*.{ts,tsx,js,jsx}',
14+
'!src/demo/**/*',
15+
'!**/__stories__/**/*',
16+
'!**/*/*.stories.{ts,tsx}',
17+
],
18+
testEnvironment: '<rootDir>/test-utils/custom-environment.ts',
19+
setupFiles: ['<rootDir>/test-utils/setup-tests.ts'],
20+
setupFilesAfterEnv: ['<rootDir>/test-utils/setup-tests-after.ts'],
21+
moduleNameMapper: {
22+
'\\.(css|less|scss|sass)$': 'jest-transform-css',
23+
},
24+
testMatch: ['**/*.test.[jt]s?(x)'],
25+
};

0 commit comments

Comments
 (0)