Skip to content

Commit 73b3586

Browse files
authored
test: convert jasmine to jest (#767)
* test: convert jasmine to jest * chore: remove test:ne script * refactor: apply PR feedbacks * rechore: update eslint version, convert eslint-loader to eslint-webpack-plugin * refactor: apply PR feedbacks * chore: improve development-env (#768) * chore: improve development-env * chore: remove unnecessary config or command script * refactor: fix lint error
1 parent 008978f commit 73b3586

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+104966
-42783
lines changed

apps/calendar/.eslintrc.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ module.exports = {
44
browser: true,
55
es6: true,
66
node: true,
7-
jasmine: true,
87
},
98
parser: '@typescript-eslint/parser',
10-
plugins: ['prettier', 'react', 'react-hooks', '@typescript-eslint', 'jasmine'],
9+
plugins: ['prettier', 'react', 'react-hooks', '@typescript-eslint', 'jest'],
1110
extends: [
1211
'tui/es6',
12+
'prettier',
1313
'plugin:@typescript-eslint/recommended',
14-
'prettier/@typescript-eslint',
15-
'plugin:jasmine/recommended',
14+
'plugin:jest/recommended',
1615
'plugin:react/recommended',
1716
'plugin:prettier/recommended',
1817
],
@@ -24,7 +23,7 @@ module.exports = {
2423
settings: {
2524
react: {
2625
pragma: 'h',
27-
version: '16.3',
26+
version: '16.13',
2827
},
2928
},
3029
globals: {
@@ -41,6 +40,7 @@ module.exports = {
4140
'no-use-before-define': 0,
4241
'react-hooks/rules-of-hooks': 'error',
4342
'react-hooks/exhaustive-deps': 'error',
43+
'jest/no-conditional-expect': 0,
4444
complexity: ['error', { max: 8 }],
4545
},
4646
overrides: [

apps/calendar/jest.config.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
clearMocks: true,
3+
preset: 'ts-jest/presets/js-with-babel',
4+
moduleFileExtensions: ['js', 'json', 'jsx', 'ts', 'tsx', 'node', 'd.ts'],
5+
moduleNameMapper: {
6+
'^@src/(.*)$': '<rootDir>/src/$1',
7+
'^@test/(.*)$': '<rootDir>/test/$1',
8+
'\\.(css)$': '<rootDir>/__mocks__/styleMock.ts',
9+
},
10+
globals: { 'ts-jest': { babelConfig: true } },
11+
watchPathIgnorePatterns: ['<rootDir>/.storybook', '<rootDir>/.stories', '/node_modules/'],
12+
setupFilesAfterEnv: [
13+
'<rootDir>/test/matcher/matrices.ts',
14+
'<rootDir>/test/matcher/viewModels.ts',
15+
],
16+
};

apps/calendar/karma.conf.js

-163
This file was deleted.

0 commit comments

Comments
 (0)