Skip to content

Commit 8fc63ec

Browse files
SurajSuraj
authored andcommitted
fix: function refactor
1 parent e0add76 commit 8fc63ec

File tree

5 files changed

+46
-60
lines changed

5 files changed

+46
-60
lines changed
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
*
2-
!.gitignore
1+
node_modules .next

packages/create-next-app-with-gluestack-ui/__tests__/integration/next-app-router.test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ const isProduction = process.argv.includes('--isProduction=true');
2121

2222
describe('Create Next.js app with app router:', () => {
2323
let appProcess;
24-
console.log(process.argv, 'hewheheh');
25-
2624
beforeAll(async () => {
2725
cleanUpPort(nextAppRootDirectory, NEXT_PORT);
2826
}, 200000);

packages/create-next-app-with-gluestack-ui/__tests__/integration/next-page-router.test.js

Lines changed: 0 additions & 50 deletions
This file was deleted.

packages/create-next-app-with-gluestack-ui/__tests__/integration/utils.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const { spawnSync } = require('child_process');
22
const { spawn } = require('child_process');
33
const { promisify } = require('util');
4-
4+
const path = require("path");
55
function cleanAppDirectory(nextAppRootDirectory, APP_NAME) {
66
spawnSync('rm -rf', [APP_NAME], {
77
cwd: nextAppRootDirectory,
@@ -20,12 +20,11 @@ function createProject(
2020
// Clone the my-next-app Git repository
2121

2222
const createrCommand = isProduction
23-
? `npx create-next-app-with-gluestack-ui@latest`
24-
: 'yarn dev';
25-
console.log('create app using cli with... ', createrCommand);
23+
? `npx create-next-app-with-gluestack-ui@latest` + ` ${APP_NAME}`
24+
: 'yarn dev ' + path.join("./", path.relative( './', nextAppRootDirectory), APP_NAME);
2625

2726
return new Promise((resolve, reject) => {
28-
const child = spawn(`${createrCommand} ${APP_NAME} ${options}`, {
27+
const child = spawn(`${createrCommand} ${options}`, {
2928
cwd: nextAppRootDirectory,
3029
shell: true,
3130
});
Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<testsuites name="jest tests" tests="0" failures="0" errors="0" time="0.681">
2+
<testsuites name="jest tests" tests="4" failures="2" errors="0" time="118.047">
3+
<testsuite name="Create Next.js app with page router:" errors="0" failures="1" skipped="0" timestamp="2023-07-18T11:33:40" time="116.231" tests="2">
4+
<testcase classname="Create Next.js app with page router: Create a Next.js app with npx" name="Create Next.js app with page router: Create a Next.js app with npx" time="64.934">
5+
</testcase>
6+
<testcase classname="Create Next.js app with page router: Start and check if Next.js app is running" name="Create Next.js app with page router: Start and check if Next.js app is running" time="50.002">
7+
<failure>Error: thrown: &quot;Exceeded timeout of 50000 ms for a test.
8+
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.&quot;
9+
at it (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/__tests__/integration/next-page-router.test.js:35:3)
10+
at _dispatchDescribe (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-circus/build/index.js:91:26)
11+
at describe (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-circus/build/index.js:55:5)
12+
at Object.describe (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/__tests__/integration/next-page-router.test.js:21:1)
13+
at Runtime._execModule (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-runtime/build/index.js:1430:24)
14+
at Runtime._loadModule (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-runtime/build/index.js:1013:12)
15+
at Runtime.requireModule (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-runtime/build/index.js:873:12)
16+
at jestAdapter (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)
17+
at processTicksAndRejections (node:internal/process/task_queues:95:5)
18+
at runTestInternal (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-runner/build/runTest.js:367:16)
19+
at runTest (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-runner/build/runTest.js:444:34)
20+
at Object.worker (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-runner/build/testWorker.js:106:12)</failure>
21+
</testcase>
22+
</testsuite>
23+
<testsuite name="Create Next.js app with app router:" errors="0" failures="1" skipped="0" timestamp="2023-07-18T11:33:40" time="117.261" tests="2">
24+
<testcase classname="Create Next.js app with app router: Create a Next.js app with npx" name="Create Next.js app with app router: Create a Next.js app with npx" time="65.79">
25+
</testcase>
26+
<testcase classname="Create Next.js app with app router: Start and check if Next.js app is running" name="Create Next.js app with app router: Start and check if Next.js app is running" time="50.003">
27+
<failure>Error: thrown: &quot;Exceeded timeout of 50000 ms for a test.
28+
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout.&quot;
29+
at it (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/__tests__/integration/next-app-router.test.js:35:3)
30+
at _dispatchDescribe (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-circus/build/index.js:91:26)
31+
at describe (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-circus/build/index.js:55:5)
32+
at Object.describe (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/__tests__/integration/next-app-router.test.js:22:1)
33+
at Runtime._execModule (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-runtime/build/index.js:1430:24)
34+
at Runtime._loadModule (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-runtime/build/index.js:1013:12)
35+
at Runtime.requireModule (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-runtime/build/index.js:873:12)
36+
at jestAdapter (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)
37+
at processTicksAndRejections (node:internal/process/task_queues:95:5)
38+
at runTestInternal (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-runner/build/runTest.js:367:16)
39+
at runTest (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-runner/build/runTest.js:444:34)
40+
at Object.worker (/Users/suraj/Sites/projects/gluestack/gluestack-ui-cli/packages/create-next-app-with-gluestack-ui/node_modules/jest-runner/build/testWorker.js:106:12)</failure>
41+
</testcase>
42+
</testsuite>
343
</testsuites>

0 commit comments

Comments
 (0)