This repository was archived by the owner on May 7, 2022. It is now read-only.
File tree 5 files changed +1994
-30
lines changed
5 files changed +1994
-30
lines changed Original file line number Diff line number Diff line change 8
8
logs
9
9
storage
10
10
.env
11
- .cache
11
+ .cache
12
+ coverage
Original file line number Diff line number Diff line change
1
+ export default {
2
+ clearMocks : true ,
3
+ collectCoverage : true ,
4
+ coverageDirectory : 'coverage' ,
5
+ testRegex : '(/test/.*|(\\.|/)(test|spec))\\.[jt]sx?$' ,
6
+ transform : {
7
+ '^.+\\.(ts|tsx)?$' : 'ts-jest' ,
8
+ } ,
9
+ } ;
Original file line number Diff line number Diff line change 11
11
"scripts" : {
12
12
"dev" : " webpack serve --mode development" ,
13
13
"build" : " ttsc" ,
14
- "prepare" : " husky install"
14
+ "prepare" : " husky install" ,
15
+ "test" : " jest"
15
16
},
16
17
"lint-staged" : {
17
18
"**/*" : " prettier --write --ignore-unknown"
45
46
"@babel/preset-env" : " 7.14.2" ,
46
47
"@babel/preset-typescript" : " 7.14.5" ,
47
48
"@types/crypto-js" : " 4.0.2" ,
49
+ "@types/jest" : " 27.0.3" ,
48
50
"@types/js-cookie" : " 2.2.7" ,
49
51
"babel-loader" : " 8.2.2" ,
50
52
"husky" : " 6.0.0" ,
53
+ "jest" : " 27.3.1" ,
51
54
"lint-staged" : " 11.0.0" ,
52
55
"prettier" : " 2.3.0" ,
56
+ "ts-jest" : " 27.0.7" ,
53
57
"ts-loader" : " 9.2.1" ,
58
+ "ts-node" : " 10.4.0" ,
54
59
"ttypescript" : " 1.5.12" ,
55
60
"typescript" : " 4.2.4" ,
56
61
"webpack" : " 5.37.1" ,
Original file line number Diff line number Diff line change
1
+ import check from '../../src/utils/check' ;
2
+ import config from '../../src/config' ;
3
+
4
+ test ( 'check.valueLength' , ( ) => {
5
+ expect (
6
+ check . valueLength ( {
7
+ test1 : 'r' ,
8
+ test2 : 'r' . repeat ( config . maxValueLength ) ,
9
+ } ) ,
10
+ ) . toBe ( true ) ;
11
+ expect (
12
+ check . valueLength ( {
13
+ test1 : 'r' ,
14
+ test2 : 'r' . repeat ( config . maxValueLength + 1 ) ,
15
+ } ) ,
16
+ ) . toBe ( false ) ;
17
+ } ) ;
You can’t perform that action at this time.
0 commit comments