@react-native-harness/cli 1.0.0-alpha.15 → 1.0.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/commands/test.d.ts.map +1 -1
  2. package/dist/commands/test.js +4 -2
  3. package/dist/errors/errorHandler.d.ts +1 -1
  4. package/dist/errors/errorHandler.d.ts.map +1 -1
  5. package/dist/errors/errorHandler.js +101 -123
  6. package/dist/errors/errors.d.ts +2 -7
  7. package/dist/errors/errors.d.ts.map +1 -1
  8. package/dist/errors/errors.js +0 -17
  9. package/dist/external.d.ts +2 -0
  10. package/dist/external.d.ts.map +1 -0
  11. package/dist/external.js +1 -0
  12. package/dist/index.js +58 -49
  13. package/dist/jest.d.ts +2 -0
  14. package/dist/jest.d.ts.map +1 -0
  15. package/dist/jest.js +7 -0
  16. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  17. package/package.json +25 -8
  18. package/src/external.ts +0 -0
  19. package/src/index.ts +65 -72
  20. package/tsconfig.json +0 -3
  21. package/tsconfig.lib.json +1 -12
  22. package/src/bundlers/metro.ts +0 -102
  23. package/src/commands/test.ts +0 -228
  24. package/src/discovery/index.ts +0 -2
  25. package/src/discovery/testDiscovery.ts +0 -50
  26. package/src/errors/errorHandler.ts +0 -226
  27. package/src/errors/errors.ts +0 -131
  28. package/src/platforms/android/build.ts +0 -49
  29. package/src/platforms/android/device.ts +0 -48
  30. package/src/platforms/android/emulator.ts +0 -137
  31. package/src/platforms/android/index.ts +0 -87
  32. package/src/platforms/ios/build.ts +0 -71
  33. package/src/platforms/ios/device.ts +0 -79
  34. package/src/platforms/ios/index.ts +0 -66
  35. package/src/platforms/ios/simulator.ts +0 -171
  36. package/src/platforms/platform-adapter.ts +0 -11
  37. package/src/platforms/platform-registry.ts +0 -26
  38. package/src/platforms/vega/build.ts +0 -85
  39. package/src/platforms/vega/device.ts +0 -258
  40. package/src/platforms/vega/index.ts +0 -107
  41. package/src/platforms/web/index.ts +0 -16
  42. package/src/process.ts +0 -33
  43. package/src/utils.ts +0 -29
@@ -1,102 +0,0 @@
1
- import { type ChildProcess } from 'node:child_process';
2
- import {
3
- getReactNativeCliPath,
4
- getExpoCliPath,
5
- getTimeoutSignal,
6
- spawn,
7
- logger,
8
- SubprocessError,
9
- } from '@react-native-harness/tools';
10
- import { isPortAvailable } from '../utils.js';
11
- import { MetroPortUnavailableError } from '../errors/errors.js';
12
-
13
- const METRO_PORT = 8081;
14
-
15
- export const runMetro = async (isExpo = false): Promise<ChildProcess> => {
16
- const metro = spawn(
17
- 'node',
18
- [
19
- isExpo ? getExpoCliPath() : getReactNativeCliPath(),
20
- 'start',
21
- '--port',
22
- METRO_PORT.toString(),
23
- ],
24
- {
25
- env: {
26
- ...process.env,
27
- RN_HARNESS: 'true',
28
- ...(isExpo && { EXPO_NO_METRO_WORKSPACE_ROOT: 'true' }),
29
- },
30
- }
31
- );
32
-
33
- // Forward metro output to logger
34
- metro.nodeChildProcess.then((childProcess) => {
35
- if (childProcess.stdout) {
36
- childProcess.stdout.on('data', (data) => {
37
- logger.debug(data.toString().trim());
38
- });
39
- }
40
- if (childProcess.stderr) {
41
- childProcess.stderr.on('data', (data) => {
42
- logger.debug(data.toString().trim());
43
- });
44
- }
45
- });
46
-
47
- metro.catch((error) => {
48
- // This process is going to be killed by us, so we don't need to throw an error
49
- if (error instanceof SubprocessError && error.signalName === 'SIGTERM') {
50
- return;
51
- }
52
-
53
- logger.error('Metro crashed unexpectedly', error);
54
- });
55
-
56
- const isDefaultPortAvailable = await isPortAvailable(METRO_PORT);
57
-
58
- if (!isDefaultPortAvailable) {
59
- throw new MetroPortUnavailableError(METRO_PORT);
60
- }
61
-
62
- await waitForMetro();
63
- return metro.nodeChildProcess;
64
- };
65
-
66
- export const waitForMetro = async (
67
- port = 8081,
68
- maxRetries = 20,
69
- retryDelay = 1000
70
- ): Promise<void> => {
71
- let attempts = 0;
72
-
73
- while (attempts < maxRetries) {
74
- attempts++;
75
-
76
- try {
77
- const response = await fetch(`http://localhost:${port}/status`, {
78
- signal: getTimeoutSignal(100),
79
- });
80
-
81
- if (response.ok) {
82
- const body = await response.text();
83
-
84
- if (body === 'packager-status:running') {
85
- return;
86
- }
87
- }
88
- } catch {
89
- // Errors are expected here, we're just waiting for the process to be ready
90
- }
91
-
92
- if (attempts < maxRetries) {
93
- await new Promise((resolve) => setTimeout(resolve, retryDelay));
94
- }
95
- }
96
-
97
- throw new Error(`Metro bundler is not ready after ${maxRetries} attempts`);
98
- };
99
-
100
- export const reloadApp = async (): Promise<void> => {
101
- await fetch(`http://localhost:${METRO_PORT}/reload`);
102
- };
@@ -1,228 +0,0 @@
1
- import {
2
- getBridgeServer,
3
- type BridgeServer,
4
- } from '@react-native-harness/bridge/server';
5
- import { TestExecutionOptions } from '@react-native-harness/bridge';
6
- import {
7
- Config,
8
- getConfig,
9
- TestRunnerConfig,
10
- } from '@react-native-harness/config';
11
- import { getPlatformAdapter } from '../platforms/platform-registry.js';
12
- import { intro, logger, outro, spinner } from '@react-native-harness/tools';
13
- import { type Environment } from '../platforms/platform-adapter.js';
14
- import { BridgeTimeoutError } from '../errors/errors.js';
15
- import { assert } from '../utils.js';
16
- import {
17
- EnvironmentInitializationError,
18
- NoRunnerSpecifiedError,
19
- RpcClientError,
20
- RunnerNotFoundError,
21
- } from '../errors/errors.js';
22
- import { TestSuiteResult } from '@react-native-harness/bridge';
23
- import {
24
- discoverTestFiles,
25
- type TestFilterOptions,
26
- } from '../discovery/index.js';
27
-
28
- type TestRunContext = {
29
- config: Config;
30
- runner: TestRunnerConfig;
31
- bridge?: BridgeServer;
32
- environment?: Environment;
33
- testFiles?: string[];
34
- results?: TestSuiteResult[];
35
- projectRoot: string;
36
- };
37
-
38
- const setupEnvironment = async (context: TestRunContext): Promise<void> => {
39
- const startSpinner = spinner();
40
- const platform = context.runner.platform;
41
-
42
- startSpinner.start(`Starting "${context.runner.name}" (${platform}) runner`);
43
-
44
- const platformAdapter = await getPlatformAdapter(platform);
45
- const serverBridge = await getBridgeServer({
46
- port: 3001,
47
- });
48
-
49
- context.bridge = serverBridge;
50
-
51
- const readyPromise = new Promise<void>((resolve, reject) => {
52
- const timeout = setTimeout(() => {
53
- reject(
54
- new BridgeTimeoutError(
55
- context.config.bridgeTimeout,
56
- context.runner.name,
57
- platform
58
- )
59
- );
60
- }, context.config.bridgeTimeout);
61
-
62
- serverBridge.once('ready', () => {
63
- clearTimeout(timeout);
64
- resolve();
65
- });
66
- });
67
-
68
- context.environment = await platformAdapter.getEnvironment(context.runner);
69
-
70
- logger.debug('Waiting for bridge to be ready');
71
- await readyPromise;
72
- logger.debug('Bridge is ready');
73
-
74
- if (!context.environment) {
75
- throw new EnvironmentInitializationError(
76
- 'Failed to initialize environment',
77
- context.runner.name,
78
- platform,
79
- 'Platform adapter returned null environment'
80
- );
81
- }
82
-
83
- startSpinner.stop(`"${context.runner.name}" (${platform}) runner started`);
84
- };
85
-
86
- const findTestFiles = async (
87
- context: TestRunContext,
88
- options: TestFilterOptions = {}
89
- ): Promise<void> => {
90
- const discoverSpinner = spinner();
91
- discoverSpinner.start('Discovering tests');
92
-
93
- context.testFiles = await discoverTestFiles(
94
- context.projectRoot,
95
- context.config.include,
96
- options
97
- );
98
-
99
- discoverSpinner.stop(`Found ${context.testFiles.length} test files`);
100
- };
101
-
102
- const runTests = async (
103
- context: TestRunContext,
104
- options: TestFilterOptions = {}
105
- ): Promise<void> => {
106
- const { bridge, environment, testFiles } = context;
107
- assert(bridge != null, 'Bridge not initialized');
108
- assert(environment != null, 'Environment not initialized');
109
- assert(testFiles != null, 'Test files not initialized');
110
-
111
- let runSpinner = spinner();
112
- runSpinner.start('Running tests');
113
-
114
- let shouldRestart = false;
115
-
116
- for (const testFile of testFiles) {
117
- if (shouldRestart) {
118
- runSpinner = spinner();
119
- runSpinner.start(`Restarting environment for next test file`);
120
-
121
- await new Promise((resolve) => {
122
- bridge.once('ready', resolve);
123
- environment.restart();
124
- });
125
- }
126
-
127
- runSpinner.message(`Running tests in ${testFile}`);
128
- const client = bridge.rpc.clients.at(-1);
129
- if (!client) {
130
- throw new RpcClientError(
131
- 'No RPC client available',
132
- 3001,
133
- 'No clients connected'
134
- );
135
- }
136
-
137
- // Pass only testNamePattern to runtime (file filtering already done)
138
- const executionOptions: TestExecutionOptions = {
139
- testNamePattern: options.testNamePattern,
140
- };
141
-
142
- const result = await client.runTests(testFile, executionOptions);
143
- context.results = [...(context.results ?? []), ...result.suites];
144
- shouldRestart = true;
145
- runSpinner.stop(`Test file ${testFile} completed`);
146
- }
147
-
148
- runSpinner.stop('Tests completed');
149
- };
150
-
151
- const cleanUp = async (context: TestRunContext): Promise<void> => {
152
- if (context.bridge) {
153
- context.bridge.dispose();
154
- }
155
- if (context.environment) {
156
- await context.environment.dispose();
157
- }
158
- };
159
-
160
- const hasFailedTests = (results: TestSuiteResult[]): boolean => {
161
- for (const suite of results) {
162
- // Check if the suite itself failed
163
- if (suite.status === 'failed') {
164
- return true;
165
- }
166
-
167
- // Check individual tests in the suite
168
- for (const test of suite.tests) {
169
- if (test.status === 'failed') {
170
- return true;
171
- }
172
- }
173
-
174
- // Recursively check nested suites
175
- if (suite.suites && hasFailedTests(suite.suites)) {
176
- return true;
177
- }
178
- }
179
-
180
- return false;
181
- };
182
-
183
- export const testCommand = async (
184
- runnerName?: string,
185
- options: TestFilterOptions = {}
186
- ): Promise<void> => {
187
- intro('React Native Test Harness');
188
-
189
- const { config, projectRoot } = await getConfig(process.cwd());
190
- const selectedRunnerName = runnerName ?? config.defaultRunner;
191
-
192
- if (!selectedRunnerName) {
193
- throw new NoRunnerSpecifiedError(config.runners);
194
- }
195
-
196
- const runner = config.runners.find((r) => r.name === selectedRunnerName);
197
-
198
- if (!runner) {
199
- throw new RunnerNotFoundError(selectedRunnerName, config.runners);
200
- }
201
-
202
- const context: TestRunContext = {
203
- config,
204
- runner,
205
- testFiles: [],
206
- results: [],
207
- projectRoot,
208
- };
209
-
210
- try {
211
- await setupEnvironment(context);
212
- await findTestFiles(context, options);
213
- await runTests(context, options);
214
-
215
- assert(context.results != null, 'Results not initialized');
216
- config.reporter?.report(context.results);
217
- } finally {
218
- await cleanUp(context);
219
- }
220
-
221
- // Check if any tests failed and exit with appropriate code
222
- if (hasFailedTests(context.results)) {
223
- outro('Test run completed with failures');
224
- process.exit(1);
225
- } else {
226
- outro('Test run completed successfully');
227
- }
228
- };
@@ -1,2 +0,0 @@
1
- export { discoverTestFiles } from './testDiscovery.js';
2
- export type { TestFilterOptions } from './testDiscovery.js';
@@ -1,50 +0,0 @@
1
- import { Glob } from 'glob';
2
-
3
- export type TestFilterOptions = {
4
- testNamePattern?: string;
5
- testPathPattern?: string;
6
- testPathIgnorePatterns?: string[];
7
- testMatch?: string[];
8
- };
9
-
10
- /**
11
- * Discovers test files based on patterns and filtering options
12
- */
13
- export const discoverTestFiles = async (
14
- projectRoot: string,
15
- configInclude: string | string[],
16
- options: TestFilterOptions = {}
17
- ): Promise<string[]> => {
18
- // Priority: testMatch > configInclude
19
- const patterns = options.testMatch || configInclude;
20
- const patternArray = Array.isArray(patterns) ? patterns : [patterns];
21
-
22
- // Glob discovery
23
- const allFiles: string[] = [];
24
- for (const pattern of patternArray) {
25
- const glob = new Glob(pattern, { cwd: projectRoot, nodir: true });
26
- const files = await glob.walk();
27
- allFiles.push(...files);
28
- }
29
-
30
- // Remove duplicates
31
- let uniqueFiles = [...new Set(allFiles)];
32
-
33
- // Apply testPathPattern filtering
34
- if (options.testPathPattern) {
35
- const regex = new RegExp(options.testPathPattern);
36
- uniqueFiles = uniqueFiles.filter((file) => regex.test(file));
37
- }
38
-
39
- // Apply testPathIgnorePatterns filtering
40
- if (options.testPathIgnorePatterns?.length) {
41
- const ignoreRegexes = options.testPathIgnorePatterns.map(
42
- (p) => new RegExp(p)
43
- );
44
- uniqueFiles = uniqueFiles.filter(
45
- (file) => !ignoreRegexes.some((regex) => regex.test(file))
46
- );
47
- }
48
-
49
- return uniqueFiles;
50
- };
@@ -1,226 +0,0 @@
1
- import {
2
- ConfigLoadError,
3
- ConfigNotFoundError,
4
- ConfigValidationError,
5
- } from '@react-native-harness/config';
6
- import { AssertionError } from '../utils.js';
7
- import {
8
- NoRunnerSpecifiedError,
9
- RunnerNotFoundError,
10
- EnvironmentInitializationError,
11
- TestExecutionError,
12
- RpcClientError,
13
- AppNotInstalledError,
14
- BridgeTimeoutError,
15
- BundlingFailedError,
16
- MetroPortUnavailableError,
17
- } from './errors.js';
18
-
19
- export const handleError = (error: unknown): void => {
20
- if (error instanceof AssertionError) {
21
- console.error(`\n❌ Assertion Error`);
22
- console.error(`\nError: ${error.message}`);
23
- console.error(`\nPlease check your configuration and try again.`);
24
- } else if (error instanceof ConfigValidationError) {
25
- console.error(`\n❌ Configuration Error`);
26
- console.error(`\nFile: ${error.filePath}`);
27
- console.error(`\nValidation errors:`);
28
- error.validationErrors.forEach((err) => {
29
- console.error(` • ${err}`);
30
- });
31
- console.error(`\nPlease fix the configuration errors and try again.`);
32
- } else if (error instanceof ConfigNotFoundError) {
33
- console.error(`\n❌ Configuration Not Found`);
34
- console.error(
35
- `\nCould not find 'rn-harness.config' in '${error.searchPath}' or any parent directories.`
36
- );
37
- console.error(`\nSupported file extensions: .js, .mjs, .cjs, .json`);
38
- console.error(
39
- `\nPlease create a configuration file or run from a directory that contains one.`
40
- );
41
- } else if (error instanceof ConfigLoadError) {
42
- console.error(`\n❌ Configuration Load Error`);
43
- console.error(`\nFile: ${error.filePath}`);
44
- console.error(`Error: ${error.message}`);
45
- if (error.cause) {
46
- console.error(`\nCause: ${error.cause.message}`);
47
- }
48
- console.error(
49
- `\nPlease check your configuration file syntax and try again.`
50
- );
51
- } else if (error instanceof NoRunnerSpecifiedError) {
52
- console.error('\n❌ No runner specified');
53
- console.error(
54
- '\nPlease specify a runner name or set a defaultRunner in your config.'
55
- );
56
- console.error('\nUsage: react-native-harness test [runner-name] [pattern]');
57
- console.error('\nAvailable runners:');
58
- error.availableRunners.forEach((r) => {
59
- console.error(` • ${r.name} (${r.platform})`);
60
- });
61
- console.error(
62
- '\nTo set a default runner, add "defaultRunner" to your config:'
63
- );
64
- console.error(' { "defaultRunner": "your-runner-name" }');
65
- } else if (error instanceof RunnerNotFoundError) {
66
- console.error(`\n❌ Runner "${error.runnerName}" not found`);
67
- console.error('\nAvailable runners:');
68
- error.availableRunners.forEach((r) => {
69
- console.error(` • ${r.name} (${r.platform})`);
70
- });
71
- console.error('\nTo add a new runner, update your rn-harness.config file.');
72
- } else if (error instanceof EnvironmentInitializationError) {
73
- console.error(`\n❌ Environment Initialization Error`);
74
- console.error(`\nRunner: ${error.runnerName} (${error.platform})`);
75
- console.error(`\nError: ${error.message}`);
76
- if (error.details) {
77
- console.error(`\nDetails: ${error.details}`);
78
- }
79
- console.error(`\nTroubleshooting steps:`);
80
- console.error(
81
- ` • Verify that ${error.platform} development environment is properly set up`
82
- );
83
- console.error(` • Check that the app is built and ready for testing`);
84
- console.error(` • Ensure all required dependencies are installed`);
85
- if (error.platform === 'ios') {
86
- console.error(` • Verify Xcode and iOS Simulator are working correctly`);
87
- } else if (error.platform === 'android') {
88
- console.error(
89
- ` • Verify Android SDK and emulator are working correctly`
90
- );
91
- }
92
- console.error(
93
- `\nPlease check your environment configuration and try again.`
94
- );
95
- } else if (error instanceof TestExecutionError) {
96
- console.error(`\n❌ Test Execution Error`);
97
- console.error(`\nFile: ${error.testFile}`);
98
- if (error.testSuite) {
99
- console.error(`\nSuite: ${error.testSuite}`);
100
- }
101
- if (error.testName) {
102
- console.error(`\nTest: ${error.testName}`);
103
- }
104
- console.error(`\nError: ${error.message}`);
105
- console.error(`\nTroubleshooting steps:`);
106
- console.error(` • Check the test file syntax and logic`);
107
- console.error(` • Verify all test dependencies are available`);
108
- console.error(` • Ensure the app is in the expected state for the test`);
109
- console.error(
110
- ` • Check device/emulator logs for additional error details`
111
- );
112
- console.error(`\nPlease check your test file and try again.`);
113
- } else if (error instanceof RpcClientError) {
114
- console.error(`\n❌ RPC Client Error`);
115
- console.error(`\nError: ${error.message}`);
116
- if (error.bridgePort) {
117
- console.error(`\nBridge Port: ${error.bridgePort}`);
118
- }
119
- if (error.connectionStatus) {
120
- console.error(`\nConnection Status: ${error.connectionStatus}`);
121
- }
122
- console.error(`\nTroubleshooting steps:`);
123
- console.error(` • Verify the React Native app is running and connected`);
124
- console.error(` • Check that the bridge port is not blocked by firewall`);
125
- console.error(
126
- ` • Ensure the app has the React Native Harness runtime integrated`
127
- );
128
- console.error(` • Try restarting the app and test harness`);
129
- console.error(`\nPlease check your bridge connection and try again.`);
130
- } else if (error instanceof AppNotInstalledError) {
131
- console.error(`\n❌ App Not Installed`);
132
- const deviceType =
133
- error.platform === 'ios'
134
- ? 'simulator'
135
- : error.platform === 'android'
136
- ? 'emulator'
137
- : 'virtual device';
138
- console.error(
139
- `\nThe app "${error.bundleId}" is not installed on ${deviceType} "${error.deviceName}".`
140
- );
141
- console.error(`\nTo resolve this issue:`);
142
- if (error.platform === 'ios') {
143
- console.error(
144
- ` • Build and install the app: npx react-native run-ios --simulator="${error.deviceName}"`
145
- );
146
- console.error(
147
- ` • Or install from Xcode: Open ios/*.xcworkspace and run the project`
148
- );
149
- } else if (error.platform === 'android') {
150
- console.error(
151
- ` • Build and install the app: npx react-native run-android`
152
- );
153
- console.error(
154
- ` • Or build manually: ./gradlew assembleDebug && adb install android/app/build/outputs/apk/debug/app-debug.apk`
155
- );
156
- } else if (error.platform === 'vega') {
157
- console.error(` • Build the Vega app: npm run build:app`);
158
- console.error(
159
- ` • Install the app: kepler device install-app -p <path-to-vpkg> --device "${error.deviceName}"`
160
- );
161
- console.error(
162
- ` • Or use the combined command: kepler run-kepler <path-to-vpkg> "${error.bundleId}" -d "${error.deviceName}"`
163
- );
164
- }
165
- console.error(`\nPlease install the app and try running the tests again.`);
166
- } else if (error instanceof BundlingFailedError) {
167
- console.error(`\n❌ Test File Bundling Error`);
168
- console.error(`\nFile: ${error.modulePath}`);
169
- console.error(`\nError: ${error.reason}`);
170
- console.error(`\nTroubleshooting steps:`);
171
- console.error(` • Check the test file syntax and imports`);
172
- console.error(` • Verify all imported modules exist and are accessible`);
173
- console.error(` • Ensure the Metro bundler configuration is correct`);
174
- console.error(` • Check for any circular dependencies in the test file`);
175
- console.error(` • Verify that all required packages are installed`);
176
- console.error(`\nPlease fix the bundling issues and try again.`);
177
- } else if (error instanceof BridgeTimeoutError) {
178
- console.error(`\n❌ Bridge Connection Timeout`);
179
- console.error(
180
- `\nThe bridge connection timed out after ${error.timeout}ms while waiting for the "${error.runnerName}" (${error.platform}) runner to be ready.`
181
- );
182
- console.error(`\nThis usually indicates that:`);
183
- console.error(
184
- ` • The React Native app failed to load or connect to the bridge`
185
- );
186
- console.error(` • The app crashed during startup`);
187
- console.error(
188
- ` • Network connectivity issues between the app and the test harness`
189
- );
190
- console.error(` • The app is taking longer than expected to initialize`);
191
- console.error(`\nTo resolve this issue:`);
192
- console.error(
193
- ` • Check that the app is properly installed and can start normally`
194
- );
195
- console.error(
196
- ` • Verify that the app has the React Native Harness runtime integrated`
197
- );
198
- console.error(` • Check device/emulator logs for any startup errors`);
199
- console.error(
200
- ` • Ensure the test harness bridge port (3001) is not blocked`
201
- );
202
- console.error(
203
- `\nIf the app needs more time to start, consider increasing the timeout in the configuration.`
204
- );
205
- } else if (error instanceof MetroPortUnavailableError) {
206
- console.error(`\n❌ Metro Port Unavailable`);
207
- console.error(`\nPort ${error.port} is already in use or unavailable.`);
208
- console.error(`\nThis usually indicates that:`);
209
- console.error(` • Another Metro bundler instance is already running`);
210
- console.error(` • Another application is using port ${error.port}`);
211
- console.error(` • The port is blocked by a firewall or security software`);
212
- console.error(`\nTo resolve this issue:`);
213
- console.error(` • Stop any running Metro bundler instances`);
214
- console.error(
215
- ` • Check for other applications using port ${error.port}: lsof -i :${error.port}`
216
- );
217
- console.error(` • Kill the process using the port: kill -9 <PID>`);
218
- console.error(
219
- ` • Or use a different port by updating your Metro configuration`
220
- );
221
- console.error(`\nPlease free up the port and try again.`);
222
- } else {
223
- console.error(`\n❌ Unexpected Error`);
224
- console.error(error);
225
- }
226
- };