Skip to content

Commit 0884f4f

Browse files
committed
chore: fix ci
1 parent 755bcd7 commit 0884f4f

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

packages/create-app/src/lib/__tests__/e2e.test.ts

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ beforeEach(() => {
1111
mkdirSync(TEMP_DIR, { recursive: true });
1212
});
1313

14-
describe('create-app command', () => {
14+
describe('create-app command', { timeout: 30_000 }, () => {
1515
it('should create a new project from npm template', async () => {
1616
const projectName = 'test-npm-template';
1717
const projectPath = path.resolve(TEMP_DIR, projectName);
@@ -37,29 +37,33 @@ describe('create-app command', () => {
3737
expect(packageJson.name).toBe(`@testing-library/react-native`); // TODO: update project name
3838
});
3939

40-
it('should create a new project from local directory template', async () => {
41-
const projectName = 'test-local-dir-template';
42-
const projectPath = path.resolve(TEMP_DIR, projectName);
40+
it(
41+
'should create a new project from local directory template',
42+
{ timeout: 30_000 },
43+
async () => {
44+
const projectName = 'test-local-dir-template';
45+
const projectPath = path.resolve(TEMP_DIR, projectName);
4346

44-
console.log('TEMP_DIR2', TEMP_DIR);
45-
console.log('projectPath2', projectPath);
47+
console.log('TEMP_DIR2', TEMP_DIR);
48+
console.log('projectPath2', projectPath);
4649

47-
if (existsSync(projectPath)) {
48-
rmSync(projectPath, { recursive: true, force: true });
49-
}
50+
if (existsSync(projectPath)) {
51+
rmSync(projectPath, { recursive: true, force: true });
52+
}
5053

51-
const templatePath = `${TEMPLATES_DIR}/rnef-template-default`;
52-
await execAsync(
53-
`cd ${TEMP_DIR} && node ${CREATE_APP_PATH} ${projectName} --template="${templatePath}"`
54-
);
54+
const templatePath = `${TEMPLATES_DIR}/rnef-template-default`;
55+
await execAsync(
56+
`cd ${TEMP_DIR} && node ${CREATE_APP_PATH} ${projectName} --template="${templatePath}"`
57+
);
5558

56-
// Check if package.json is created
57-
const packageJsonPath = path.join(projectPath, 'package.json');
58-
console.log('packageJsonPath2', packageJsonPath);
59-
expect(existsSync(packageJsonPath)).toBe(true);
59+
// Check if package.json is created
60+
const packageJsonPath = path.join(projectPath, 'package.json');
61+
console.log('packageJsonPath2', packageJsonPath);
62+
expect(existsSync(packageJsonPath)).toBe(true);
6063

61-
// Optionally, verify contents of package.json
62-
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
63-
expect(packageJson.name).toBe('@callstack/rnef-template-default'); // TODO: projectName
64-
});
64+
// Optionally, verify contents of package.json
65+
const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
66+
expect(packageJson.name).toBe('@callstack/rnef-template-default'); // TODO: projectName
67+
}
68+
);
6569
});

project.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
}
1313
},
1414
"test": {
15-
"executor": "@nx/vite:test"
15+
"executor": "@nrwl/workspace:run-commands",
16+
"options": {
17+
"commands": ["echo We dont run tests from the root project"]
18+
}
1619
}
1720
}

0 commit comments

Comments
 (0)