@@ -35,7 +35,7 @@ function createCorruptedSetupEnvScript() {
35
35
} ;
36
36
}
37
37
38
- beforeAll ( ( ) => {
38
+ beforeEach ( ( ) => {
39
39
// Clean up folder and re-create a new project
40
40
cleanup ( DIR ) ;
41
41
writeFiles ( DIR , { } ) ;
@@ -122,6 +122,20 @@ module.exports = {
122
122
};
123
123
` ;
124
124
125
+ const USER_CONFIG_TS = `
126
+ export default {
127
+ commands: [
128
+ {
129
+ name: 'test-command-ts',
130
+ description: 'test command',
131
+ func: () => {
132
+ console.log('test-command-ts');
133
+ },
134
+ },
135
+ ],
136
+ };
137
+ ` ;
138
+
125
139
const USER_CONFIG_ESM = `
126
140
export default {
127
141
commands: [
@@ -147,11 +161,11 @@ test('should read user config from react-native.config.js', () => {
147
161
148
162
test ( 'should read user config from react-native.config.ts' , ( ) => {
149
163
writeFiles ( path . join ( DIR , 'TestProject' ) , {
150
- 'react-native.config.ts' : USER_CONFIG ,
164
+ 'react-native.config.ts' : USER_CONFIG_TS ,
151
165
} ) ;
152
166
153
- const { stdout} = runCLI ( path . join ( DIR , 'TestProject' ) , [ 'test-command' ] ) ;
154
- expect ( stdout ) . toBe ( 'test-command' ) ;
167
+ const { stdout} = runCLI ( path . join ( DIR , 'TestProject' ) , [ 'test-command-ts ' ] ) ;
168
+ expect ( stdout ) . toBe ( 'test-command-ts ' ) ;
155
169
} ) ;
156
170
157
171
test ( 'should read user config from react-native.config.mjs' , ( ) => {
0 commit comments