File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -122,6 +122,20 @@ module.exports = {
122122};
123123` ;
124124
125+ const USER_CONFIG_ESM = `
126+ export default {
127+ commands: [
128+ {
129+ name: 'test-command-esm',
130+ description: 'test command',
131+ func: () => {
132+ console.log('test-command-esm');
133+ },
134+ },
135+ ],
136+ };
137+ ` ;
138+
125139test ( 'should read user config from react-native.config.js' , ( ) => {
126140 writeFiles ( path . join ( DIR , 'TestProject' ) , {
127141 'react-native.config.js' : USER_CONFIG ,
@@ -139,3 +153,12 @@ test('should read user config from react-native.config.ts', () => {
139153 const { stdout} = runCLI ( path . join ( DIR , 'TestProject' ) , [ 'test-command' ] ) ;
140154 expect ( stdout ) . toBe ( 'test-command' ) ;
141155} ) ;
156+
157+ test ( 'should read user config from react-native.config.mjs' , ( ) => {
158+ writeFiles ( path . join ( DIR , 'TestProject' ) , {
159+ 'react-native.config.mjs' : USER_CONFIG_ESM ,
160+ } ) ;
161+
162+ const { stdout} = runCLI ( path . join ( DIR , 'TestProject' ) , [ 'test-command-esm' ] ) ;
163+ expect ( stdout ) . toBe ( 'test-command-esm' ) ;
164+ } ) ;
You can’t perform that action at this time.
0 commit comments