@@ -75,3 +75,48 @@ test('negated flags override previous flags', () => {
75
75
76
76
expect ( globalConfig . silent ) . toBe ( true ) ;
77
77
} ) ;
78
+
79
+ test ( 'should work with define config function taking in config object' , ( ) => {
80
+ const result = runJest ( 'config-utils' , [
81
+ '--config=jest.config.ts' ,
82
+ '__tests__/simple.test.js' ,
83
+ ] ) ;
84
+
85
+ expect ( result . exitCode ) . toBe ( 0 ) ;
86
+ } ) ;
87
+
88
+ test ( 'should work with define config function taking in callback' , ( ) => {
89
+ const result = runJest ( 'config-utils' , [
90
+ '--config=jest.callback.config.ts' ,
91
+ '__tests__/simple.test.js' ,
92
+ ] ) ;
93
+
94
+ expect ( result . exitCode ) . toBe ( 0 ) ;
95
+ } ) ;
96
+
97
+ test ( 'should work with merged config of 2 config objects' , ( ) => {
98
+ const result = runJest ( 'config-utils' , [
99
+ '--config=jest.merge.config.ts' ,
100
+ '__tests__/merge.test.js' ,
101
+ ] ) ;
102
+
103
+ expect ( result . exitCode ) . toBe ( 0 ) ;
104
+ } ) ;
105
+
106
+ test ( 'should work with merged config of one config object with a define function config' , ( ) => {
107
+ const result = runJest ( 'config-utils' , [
108
+ '--config=jest.merge-with-define.config.ts' ,
109
+ '__tests__/merge.test.js' ,
110
+ ] ) ;
111
+
112
+ expect ( result . exitCode ) . toBe ( 0 ) ;
113
+ } ) ;
114
+
115
+ test ( 'should work with merged config as callback for define function config' , ( ) => {
116
+ const result = runJest ( 'config-utils' , [
117
+ '--config=jest.merge-with-callback.config.ts' ,
118
+ '__tests__/merge.test.js' ,
119
+ ] ) ;
120
+
121
+ expect ( result . exitCode ) . toBe ( 0 ) ;
122
+ } ) ;
0 commit comments