+17
-5
@@ -47,9 +47,8 @@ Deno.test({
|
||||
"-A",
|
||||
"init.ts",
|
||||
tmpDirName,
|
||||
"--no-twind",
|
||||
"--no-vscode",
|
||||
],
|
||||
stdin: "null",
|
||||
stdout: "null",
|
||||
});
|
||||
const { code } = await cliProcess.status();
|
||||
@@ -107,6 +106,7 @@ Deno.test({
|
||||
await t.step("start up the server and access the root page", async () => {
|
||||
const serverProcess = Deno.run({
|
||||
cmd: ["deno", "run", "-A", "--check", "main.ts"],
|
||||
stdin: "null",
|
||||
stdout: "piped",
|
||||
stderr: "inherit",
|
||||
cwd: tmpDirName,
|
||||
@@ -119,7 +119,7 @@ Deno.test({
|
||||
let started = false;
|
||||
for await (const line of lines) {
|
||||
console.log(line);
|
||||
if (line.includes("Server listening on http://")) {
|
||||
if (line.includes("Listening on http://")) {
|
||||
started = true;
|
||||
break;
|
||||
}
|
||||
@@ -136,7 +136,9 @@ Deno.test({
|
||||
assertEquals(res.status, 200);
|
||||
|
||||
// verify the island is revived.
|
||||
const browser = await puppeteer.launch({ args: ["--no-sandbox"] });
|
||||
const browser = await puppeteer.launch({
|
||||
args: ["--no-sandbox"],
|
||||
});
|
||||
const page = await browser.newPage();
|
||||
await page.goto("http://localhost:8000", { waitUntil: "networkidle2" });
|
||||
const counter = await page.$("body > div > div > p");
|
||||
@@ -146,7 +148,10 @@ Deno.test({
|
||||
const buttonPlus = await page.$("body > div > div > button:nth-child(3)");
|
||||
await buttonPlus?.click();
|
||||
|
||||
await delay(100);
|
||||
|
||||
counterValue = await counter?.evaluate((el) => el.textContent);
|
||||
console.log(counterValue);
|
||||
assert(counterValue === "4");
|
||||
await page.close();
|
||||
await browser.close();
|
||||
@@ -177,6 +182,7 @@ Deno.test({
|
||||
"--twind",
|
||||
"--vscode",
|
||||
],
|
||||
stdin: "null",
|
||||
stdout: "null",
|
||||
});
|
||||
const { code } = await cliProcess.status();
|
||||
@@ -249,6 +255,7 @@ Deno.test({
|
||||
await t.step("start up the server and access the root page", async () => {
|
||||
const serverProcess = Deno.run({
|
||||
cmd: ["deno", "run", "-A", "--check", "main.ts"],
|
||||
stdin: "null",
|
||||
stdout: "piped",
|
||||
stderr: "inherit",
|
||||
cwd: tmpDirName,
|
||||
@@ -261,7 +268,7 @@ Deno.test({
|
||||
let started = false;
|
||||
for await (const line of lines) {
|
||||
console.log(line);
|
||||
if (line.includes("Server listening on http://")) {
|
||||
if (line.includes("Listening on http://")) {
|
||||
started = true;
|
||||
break;
|
||||
}
|
||||
@@ -294,6 +301,8 @@ Deno.test({
|
||||
const buttonPlus = await page.$("body > div > div > button:nth-child(3)");
|
||||
await buttonPlus?.click();
|
||||
|
||||
await delay(100);
|
||||
|
||||
counterValue = await counter?.evaluate((el) => el.textContent);
|
||||
assert(counterValue === "4");
|
||||
await page.close();
|
||||
@@ -316,6 +325,7 @@ Deno.test("fresh-init error(help)", async function (t) {
|
||||
async () => {
|
||||
const cliProcess = Deno.run({
|
||||
cmd: ["deno", "run", "-A", "init.ts"],
|
||||
stdin: "null",
|
||||
stderr: "piped",
|
||||
});
|
||||
const { code } = await cliProcess.status();
|
||||
@@ -334,6 +344,7 @@ Deno.test("fresh-init error(help)", async function (t) {
|
||||
async () => {
|
||||
const cliProcess = Deno.run({
|
||||
cmd: ["deno", "run", "-A", "init.ts", "-f"],
|
||||
stdin: "null",
|
||||
stderr: "piped",
|
||||
});
|
||||
const { code } = await cliProcess.status();
|
||||
@@ -352,6 +363,7 @@ Deno.test("fresh-init error(help)", async function (t) {
|
||||
async () => {
|
||||
const cliProcess = Deno.run({
|
||||
cmd: ["deno", "run", "-A", "init.ts", "--foo"],
|
||||
stdin: "null",
|
||||
stderr: "piped",
|
||||
});
|
||||
const { code } = await cliProcess.status();
|
||||
|
||||
Reference in New Issue
Block a user