diff --git a/__e2e__/__snapshots__/config.test.ts.snap b/__e2e__/__snapshots__/config.test.ts.snap index da5f4d7d1..63c270c7a 100644 --- a/__e2e__/__snapshots__/config.test.ts.snap +++ b/__e2e__/__snapshots__/config.test.ts.snap @@ -4,7 +4,7 @@ exports[`shows up current config without unnecessary output 1`] = ` { "root": "<>/TestProject", "reactNativePath": "<>/TestProject/node_modules/react-native", - "reactNativeVersion": "0.78", + "reactNativeVersion": "0.79", "dependencies": {}, "commands": [ { diff --git a/__e2e__/config.test.ts b/__e2e__/config.test.ts index 322b63829..8dfd3e90b 100644 --- a/__e2e__/config.test.ts +++ b/__e2e__/config.test.ts @@ -49,9 +49,8 @@ beforeEach(() => { // Initialise React Native project runCLI(DIR, ['init', 'TestProject', '--install-pods']); - // Link CLI to the project - spawnScript('yarn', ['link', __dirname, '--all'], { + spawnScript('yarn', ['link', '--all'], { cwd: path.join(DIR, 'TestProject'), }); }); @@ -196,9 +195,13 @@ test('should fail if using require() in ES module in react-native.config.mjs', ( 'test-command-esm', ]); expect(stderr).toMatch('error Failed to load configuration of your project'); - expect(stdout).toMatch( - 'ReferenceError: require is not defined in ES module scope, you can use import instead', - ); + if (process.version.startsWith('v18.')) { + expect(stdout).toMatch( + 'ReferenceError: require is not defined in ES module scope, you can use import instead', + ); + } else { + expect(stdout).toContain('Cannot require() ES Module'); + } }); test('should fail if using require() in ES module with "type": "module" in package.json', () => { diff --git a/__e2e__/root.test.ts b/__e2e__/root.test.ts index 91265c592..8d7c93ae1 100644 --- a/__e2e__/root.test.ts +++ b/__e2e__/root.test.ts @@ -19,7 +19,7 @@ beforeAll(() => { runCLI(DIR, ['init', 'TestProject', `--pm`, 'npm', `--install-pods`]); // Link CLI to the project - spawnScript('yarn', ['link', __dirname, '--all'], { + spawnScript('yarn', ['link', '--all'], { cwd: path.join(DIR, 'TestProject'), }); });