Skip to content

Commit ebe3911

Browse files
committed
tests: add checks to validate is config is properly received
1 parent 77fd74b commit ebe3911

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

__e2e__/config.test.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
125139
test('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+
});

0 commit comments

Comments
 (0)