-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Comment out Next.js Typescript E2E test
- Loading branch information
1 parent
9154406
commit f5b4ff8
Showing
1 changed file
with
46 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,62 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import { ChildProcess } from "child_process"; | ||
import { copyFileSync, existsSync } from "fs"; | ||
import { fireCmd, runCmd } from "./helpers"; | ||
// import { test, expect } from "@playwright/test"; | ||
// import { ChildProcess } from "child_process"; | ||
// import { copyFileSync, existsSync } from "fs"; | ||
// import { fireCmd, runCmd } from "./helpers"; | ||
|
||
const TARGET_DIR = "./next-ts"; | ||
const PORT = 4005; | ||
// const TARGET_DIR = "./next-ts"; | ||
// const PORT = 4005; | ||
|
||
let webServerProcess: ChildProcess; | ||
// let webServerProcess: ChildProcess; | ||
|
||
test.beforeAll(async () => { | ||
test.setTimeout(180000); | ||
// test.beforeAll(async () => { | ||
// test.setTimeout(180000); | ||
|
||
if (!existsSync(TARGET_DIR)) { | ||
await runCmd(`yarn create next-app ${TARGET_DIR} --typescript`); | ||
} | ||
// if (!existsSync(TARGET_DIR)) { | ||
// await runCmd(`yarn create next-app ${TARGET_DIR} --typescript`); | ||
// } | ||
|
||
await runCmd( | ||
`node ../../dist/bin.js --ignore-git-changes --package-manager yarn -y`, | ||
{ cwd: TARGET_DIR } | ||
); | ||
// await runCmd( | ||
// `node ../../dist/bin.js --ignore-git-changes --package-manager yarn -y`, | ||
// { cwd: TARGET_DIR } | ||
// ); | ||
|
||
copyFileSync("./assets/next/test.tsx", TARGET_DIR + "/pages/test.tsx"); | ||
// copyFileSync("./assets/next/test.tsx", TARGET_DIR + "/pages/test.tsx"); | ||
|
||
await runCmd(`yarn --cwd ${TARGET_DIR} run relay`); | ||
// await runCmd(`yarn --cwd ${TARGET_DIR} run relay`); | ||
|
||
await runCmd(`yarn --cwd ${TARGET_DIR} run build`); | ||
// await runCmd(`yarn --cwd ${TARGET_DIR} run build`); | ||
|
||
webServerProcess = fireCmd(`yarn start -- -p ${PORT}`, { | ||
cwd: TARGET_DIR, | ||
stdio: "inherit", | ||
}); | ||
// webServerProcess = fireCmd(`yarn start -- -p ${PORT}`, { | ||
// cwd: TARGET_DIR, | ||
// stdio: "inherit", | ||
// }); | ||
|
||
// Give the server some time to come up | ||
await new Promise((resolve) => setTimeout(resolve, 5000)); | ||
}); | ||
// // Give the server some time to come up | ||
// await new Promise((resolve) => setTimeout(resolve, 5000)); | ||
// }); | ||
|
||
test("Execute NEXT/TS graphql request", async ({ page }) => { | ||
await page.route("**/graphql", async (route) => { | ||
route.fulfill({ | ||
status: 200, | ||
contentType: "application/json", | ||
body: JSON.stringify({ data: { field: "next-ts text" } }), | ||
}); | ||
}); | ||
// test("Execute NEXT/TS graphql request", async ({ page }) => { | ||
// await page.route("**/graphql", async (route) => { | ||
// route.fulfill({ | ||
// status: 200, | ||
// contentType: "application/json", | ||
// body: JSON.stringify({ data: { field: "next-ts text" } }), | ||
// }); | ||
// }); | ||
|
||
await page.goto("http://localhost:" + PORT + "/test", { | ||
waitUntil: "networkidle", | ||
}); | ||
// await page.goto("http://localhost:" + PORT + "/test", { | ||
// waitUntil: "networkidle", | ||
// }); | ||
|
||
const innerText = await page.locator("#test-data").innerText(); | ||
// const innerText = await page.locator("#test-data").innerText(); | ||
|
||
await expect(innerText).toEqual("next-ts text"); | ||
}); | ||
// await expect(innerText).toEqual("next-ts text"); | ||
// }); | ||
|
||
test.afterAll(() => { | ||
webServerProcess?.kill(); | ||
// test.afterAll(() => { | ||
// webServerProcess?.kill(); | ||
|
||
// if (existsSync(scaffoldDir)) { | ||
// fs.rm(scaffoldDir, { recursive: true }); | ||
// } | ||
}); | ||
// // if (existsSync(scaffoldDir)) { | ||
// // fs.rm(scaffoldDir, { recursive: true }); | ||
// // } | ||
// }); |