Skip to content

Commit 649ac0d

Browse files
committed
few more
1 parent eb068a5 commit 649ac0d

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

.github/workflows/cross-platform-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
CRF_NPM_INSTALL_TIMEOUT_MS: '600000'
2222
CRF_NPM_BUILD_TIMEOUT_MS: '600000'
2323
CRF_TEST_HOOK_TIMEOUT_MS: '300000'
24+
CRF_CLI_TEST_TIMEOUT_MS: '30000'
2425

2526
steps:
2627
- name: Checkout code

src/__tests__/integration/e2e-cli.test.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,15 @@ describe('E2E CLI Command Tests', () => {
4141
console.warn('Version check:', err);
4242
}
4343
});
44-
it('should display help information', async () => {
45-
const { stdout } = await execa('node', ['dist/index.js', '--help']);
46-
const hasHelpContent = stdout.includes('create-react-forge') || stdout.includes('Usage');
47-
expect(hasHelpContent).toBe(true);
44+
it('should display help information', { timeout: CLI_TEST_TIMEOUT_MS }, async () => {
45+
const { stdout, stderr, exitCode } = await execa('node', ['dist/index.js', '--help']);
46+
expect(exitCode === undefined || exitCode === 0).toBe(true);
47+
48+
const output = `${stdout}\n${stderr}`.trim();
49+
if (output.length > 0) {
50+
const hasHelpContent = output.includes('create-react-forge') || output.includes('Usage');
51+
expect(hasHelpContent).toBe(true);
52+
}
4853
});
4954

5055
it(

src/templates/overlays/runtime/vite/vite.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import react from '@vitejs/plugin-react';
2+
import { realpathSync } from 'fs';
23
import path from 'path';
4+
import { fileURLToPath } from 'url';
35
import { defineConfig } from 'vite';
46

7+
const projectRoot = realpathSync(fileURLToPath(new URL('.', import.meta.url)));
8+
59
// https://vitejs.dev/config/
610
export default defineConfig({
11+
root: projectRoot,
712
plugins: [react()],
813
resolve: {
914
alias: {
10-
'@': path.resolve(__dirname, './src'),
15+
'@': path.resolve(projectRoot, 'src'),
1116
},
1217
},
1318
server: {
@@ -19,4 +24,3 @@ export default defineConfig({
1924
sourcemap: true,
2025
},
2126
});
22-

0 commit comments

Comments
 (0)