From cb567d587aef23bab44a033b0b23365f81cd973e Mon Sep 17 00:00:00 2001
From: Alan
Date: Tue, 6 Sep 2022 19:50:10 +0900
Subject: [PATCH 01/48] Add alanci.yml as the test requested
---
.github/workflows/alanci.yml | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100644 .github/workflows/alanci.yml
diff --git a/.github/workflows/alanci.yml b/.github/workflows/alanci.yml
new file mode 100644
index 0000000..28376b8
--- /dev/null
+++ b/.github/workflows/alanci.yml
@@ -0,0 +1,34 @@
+name: alanci
+
+on:
+ pull_request:
+ branches: [ main ]
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+
+ strategy:
+ matrix:
+ os: [ubuntu-latest, windows-latest, macOS-latest]
+
+ Steps:
+ - name: Checkout
+ uses: actions/checkout@v2
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Run Checksum
+ run: npm run checksum
+
+ - name: Check
+ run: npm run check
+
+ - name: Test Build
+ run: npm run build
+
+ - name: Test Run deno
+ run: |
+ deno --version
+ deno task dev
\ No newline at end of file
From c4fde93b421a93b6928ea5595ec9f6d8cf4dba69 Mon Sep 17 00:00:00 2001
From: Alan
Date: Wed, 7 Sep 2022 17:39:38 +0900
Subject: [PATCH 02/48] Add a parameter to the CI test step
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9323298..8753e21 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -34,4 +34,4 @@ jobs:
run: deno lint
- name: Test
- run: deno task start && CHROME_BIN=$(which chrome) deno task test --quiet
+ run: deno task start && CHROME_BIN=$(which chrome) deno task test --quiet --allow-none
From 86729d422f15bdf7d8ff9d3dc21a823670cb18c7 Mon Sep 17 00:00:00 2001
From: Alan
Date: Wed, 7 Sep 2022 17:47:47 +0900
Subject: [PATCH 03/48] Try removing the codes under "name: Test" which could
cause error
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8753e21..30e3991 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -34,4 +34,4 @@ jobs:
run: deno lint
- name: Test
- run: deno task start && CHROME_BIN=$(which chrome) deno task test --quiet --allow-none
+ run: deno task start
From fb362b1b3f5e40add0e1e738d55835d57354e4cd Mon Sep 17 00:00:00 2001
From: Alan
Date: Wed, 7 Sep 2022 17:53:36 +0900
Subject: [PATCH 04/48] Try changing the first character of Steps into lower
case
---
.github/workflows/alanci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/alanci.yml b/.github/workflows/alanci.yml
index 28376b8..1e732c0 100644
--- a/.github/workflows/alanci.yml
+++ b/.github/workflows/alanci.yml
@@ -12,7 +12,7 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
- Steps:
+ steps:
- name: Checkout
uses: actions/checkout@v2
From d113d231161bbe55128a5be9980bf77fe290e819 Mon Sep 17 00:00:00 2001
From: Alan
Date: Wed, 7 Sep 2022 18:02:26 +0900
Subject: [PATCH 05/48] Try adding "deno task start"
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 30e3991..1f2d520 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -34,4 +34,4 @@ jobs:
run: deno lint
- name: Test
- run: deno task start
+ run: deno task start && deno task dev
From 1275a57da496c06cca893b24dede03c3c96db0b3 Mon Sep 17 00:00:00 2001
From: Alan
Date: Wed, 7 Sep 2022 18:09:33 +0900
Subject: [PATCH 06/48] Try add back "CHROME_BIN=$(which chrome) deno task test
--quiet"
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1f2d520..7f0ceb8 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -34,4 +34,4 @@ jobs:
run: deno lint
- name: Test
- run: deno task start && deno task dev
+ run: deno task start && deno task dev && CHROME_BIN=$(which chrome) deno task test --quiet
From 5d879e2717ef1b579c7242f6b226847b8c97715f Mon Sep 17 00:00:00 2001
From: Alan
Date: Wed, 7 Sep 2022 18:27:28 +0900
Subject: [PATCH 07/48] Try adding "deno task dev" before the last test step
---
.github/workflows/ci.yml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7f0ceb8..2c26641 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -33,5 +33,8 @@ jobs:
- name: Lint
run: deno lint
+ - name: Run the app locally
+ run: deno task dev
+
- name: Test
- run: deno task start && deno task dev && CHROME_BIN=$(which chrome) deno task test --quiet
+ run: deno task start && CHROME_BIN=$(which chrome) deno task test --quiet
From f5988b9644988ba8b55404bb6241ec41900d9254 Mon Sep 17 00:00:00 2001
From: Alan
Date: Wed, 7 Sep 2022 19:20:40 +0900
Subject: [PATCH 08/48] Remove alanci.yml and add a timeout parameter to ci.yml
---
.github/workflows/alanci.yml | 34 ----------------------------------
.github/workflows/ci.yml | 1 +
2 files changed, 1 insertion(+), 34 deletions(-)
delete mode 100644 .github/workflows/alanci.yml
diff --git a/.github/workflows/alanci.yml b/.github/workflows/alanci.yml
deleted file mode 100644
index 1e732c0..0000000
--- a/.github/workflows/alanci.yml
+++ /dev/null
@@ -1,34 +0,0 @@
-name: alanci
-
-on:
- pull_request:
- branches: [ main ]
-
-jobs:
- test:
- runs-on: ubuntu-latest
-
- strategy:
- matrix:
- os: [ubuntu-latest, windows-latest, macOS-latest]
-
- steps:
- - name: Checkout
- uses: actions/checkout@v2
-
- - name: Install dependencies
- run: npm install
-
- - name: Run Checksum
- run: npm run checksum
-
- - name: Check
- run: npm run check
-
- - name: Test Build
- run: npm run build
-
- - name: Test Run deno
- run: |
- deno --version
- deno task dev
\ No newline at end of file
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 2c26641..0e0ae6c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -38,3 +38,4 @@ jobs:
- name: Test
run: deno task start && CHROME_BIN=$(which chrome) deno task test --quiet
+ timeout-minutes: 5
From f375589bb022f54edf99612a8126437075a431a9 Mon Sep 17 00:00:00 2001
From: Alan
Date: Wed, 7 Sep 2022 19:29:44 +0900
Subject: [PATCH 09/48] Set the timeout for "Run the app locally"
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0e0ae6c..b3521fe 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -35,7 +35,7 @@ jobs:
- name: Run the app locally
run: deno task dev
+ timeout-minutes: 2
- name: Test
run: deno task start && CHROME_BIN=$(which chrome) deno task test --quiet
- timeout-minutes: 5
From c6913b9a4b87c3569fe8238c1b7c36fa454cbf09 Mon Sep 17 00:00:00 2001
From: Alan
Date: Wed, 7 Sep 2022 20:20:06 +0900
Subject: [PATCH 10/48] Try with slepp 5 seconds after starting an instance
---
.github/workflows/ci.yml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b3521fe..55c4625 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -34,8 +34,9 @@ jobs:
run: deno lint
- name: Run the app locally
- run: deno task dev
- timeout-minutes: 2
+ run:
+ deno task dev
+ sleep 5
- name: Test
run: deno task start && CHROME_BIN=$(which chrome) deno task test --quiet
From c0a7e4b4c144dcbcfb6ff1aa0dae0306f92d9834 Mon Sep 17 00:00:00 2001
From: Alan
Date: Wed, 7 Sep 2022 20:59:36 +0900
Subject: [PATCH 11/48] Test adding curl after "deno task dev"
---
.github/workflows/ci.yml | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 55c4625..217e9d7 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -34,9 +34,7 @@ jobs:
run: deno lint
- name: Run the app locally
- run:
- deno task dev
- sleep 5
+ run: deno task dev & curl http://localhost:8000
- name: Test
run: deno task start && CHROME_BIN=$(which chrome) deno task test --quiet
From 024e3b095146293baf315c713badacdf72c9b50c Mon Sep 17 00:00:00 2001
From: Alan
Date: Wed, 7 Sep 2022 21:47:27 +0900
Subject: [PATCH 12/48] Try adding &
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 217e9d7..d240cac 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -34,7 +34,7 @@ jobs:
run: deno lint
- name: Run the app locally
- run: deno task dev & curl http://localhost:8000
+ run: deno task dev &
- name: Test
run: deno task start && CHROME_BIN=$(which chrome) deno task test --quiet
From a58a6299e9571ff8b67157fe111b68eee4092e0d Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 10:23:19 +0900
Subject: [PATCH 13/48] Modify index file based on text.ts _01
---
routes/index.tsx | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/routes/index.tsx b/routes/index.tsx
index 6071486..01c2f52 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -13,6 +13,27 @@ export default function Home() {
Skill Test (Software Engineer)
+
+
+
+
+
+
+
+
+
);
}
From afab101cf7d381246f1d3db8744804d518edafdb Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 10:42:16 +0900
Subject: [PATCH 14/48] Format HTML & JS codes
---
routes/index.tsx | 57 +++++++++++++++++++++++-------------------------
1 file changed, 27 insertions(+), 30 deletions(-)
diff --git a/routes/index.tsx b/routes/index.tsx
index 01c2f52..db4167b 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -3,37 +3,34 @@ import { h } from "preact";
export default function Home() {
return (
-
-
-
-
-
- Skill Test (Software Engineer)
-
-
-
-
-
-
+
+
+
+
+
+ Skill Test (Software Engineer)
+
+
+
+
+
+
-
+ if (input == "engineer") {
+ document.getElementById("div").innerText = "Job \"engineer\" is open for you!"
+ } else {
+ document.getElementById("div").innerText = "Job \"" + input + "\" is not available"
+ }
+
+ location.replace("http://localhost:8000/jobs/" + input)
+ }
+
+
);
}
From edabb85b01cd14c36b6e7cd1cc147dd16c4814a5 Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 10:47:50 +0900
Subject: [PATCH 15/48] Try a possible way to remove "error: Unexpected token
"div". Expected jsx identifier"
---
routes/index.tsx | 2 ++
1 file changed, 2 insertions(+)
diff --git a/routes/index.tsx b/routes/index.tsx
index db4167b..70aedc2 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -3,6 +3,7 @@ import { h } from "preact";
export default function Home() {
return (
+<>
+>
);
}
From 3f8793428efc89e6283f924bc309deb1d75289ec Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 10:49:36 +0900
Subject: [PATCH 16/48] Try removing format check
---
.github/workflows/ci.yml | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d240cac..f991c4b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -26,10 +26,7 @@ jobs:
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
-
- - name: Format
- run: deno fmt --check
-
+
- name: Lint
run: deno lint
From ccb293c854ac0b7bf11c05d98f7ff2a09a471513 Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 10:54:24 +0900
Subject: [PATCH 17/48] Try removing deno lint
---
.github/workflows/ci.yml | 3 ---
1 file changed, 3 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f991c4b..96a43fb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -26,9 +26,6 @@ jobs:
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
-
- - name: Lint
- run: deno lint
- name: Run the app locally
run: deno task dev &
From 32ef88b07e560def841f8cba9c41792b3e32c247 Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 11:03:03 +0900
Subject: [PATCH 18/48] Add back origianl deno test and try a new HTML format
---
.github/workflows/ci.yml | 6 ++++++
routes/index.tsx | 28 ++++++++++++++--------------
2 files changed, 20 insertions(+), 14 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 96a43fb..d240cac 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -27,6 +27,12 @@ jobs:
with:
deno-version: v1.x
+ - name: Format
+ run: deno fmt --check
+
+ - name: Lint
+ run: deno lint
+
- name: Run the app locally
run: deno task dev &
diff --git a/routes/index.tsx b/routes/index.tsx
index 70aedc2..17df5b7 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -3,7 +3,7 @@ import { h } from "preact";
export default function Home() {
return (
-<>
+<>
+
>
);
From 87e890e3d030f96a476dd86b252a14648e23cfe1 Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 11:15:19 +0900
Subject: [PATCH 19/48] Try using React Helmet for including JS codes
---
routes/index.tsx | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/routes/index.tsx b/routes/index.tsx
index 17df5b7..ac537c3 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -1,5 +1,7 @@
/** @jsx h */
import { h } from "preact";
+import { Helmet } from "react-helmet"
+
export default function Home() {
return (
@@ -19,7 +21,8 @@ export default function Home() {
-
+
+
>
);
From 79c21f8d3b23f6e345e17322e469503fce75123b Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 11:19:42 +0900
Subject: [PATCH 20/48] Add ;
---
routes/index.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/routes/index.tsx b/routes/index.tsx
index ac537c3..3c02fcb 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -24,7 +24,7 @@ export default function Home() {
From 1d654f9d71a5e96c806c4a590efba2bd210a0e69 Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 11:29:28 +0900
Subject: [PATCH 23/48] Try removing a {} from JS codes
---
routes/index.tsx | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/routes/index.tsx b/routes/index.tsx
index 9e659b8..1f584f5 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -23,16 +23,13 @@ export default function Home() {
>
From 6aa4044d3c6ca1b60d81f01c9a02e1cafee6eecc Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:35:51 +0900
Subject: [PATCH 24/48] Try removing all JS codes
---
routes/index.tsx | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/routes/index.tsx b/routes/index.tsx
index 1f584f5..8022ee2 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -5,7 +5,6 @@ import { Helmet } from "react-helmet"
export default function Home() {
return (
-<>
-
-
-
->
);
}
From eae1076132c8f8ce5e07e90a8ad603ed7949084e Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:42:25 +0900
Subject: [PATCH 25/48] Revert index.tsx
---
routes/index.tsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/routes/index.tsx b/routes/index.tsx
index 8022ee2..33e3512 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -3,6 +3,7 @@ import { h } from "preact";
import { Helmet } from "react-helmet"
+
export default function Home() {
return (
From a52d100981f09733fb47138efcc3409ec96bd49b Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:51:13 +0900
Subject: [PATCH 26/48] Revert "Revert index.tsx"
This reverts commit eae1076132c8f8ce5e07e90a8ad603ed7949084e.
---
routes/index.tsx | 1 -
1 file changed, 1 deletion(-)
diff --git a/routes/index.tsx b/routes/index.tsx
index 33e3512..8022ee2 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -3,7 +3,6 @@ import { h } from "preact";
import { Helmet } from "react-helmet"
-
export default function Home() {
return (
From cc68ba34774844a8fe8ab4339999dd301f92e728 Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:51:46 +0900
Subject: [PATCH 27/48] Revert "Try removing all JS codes"
This reverts commit 6aa4044d3c6ca1b60d81f01c9a02e1cafee6eecc.
---
routes/index.tsx | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/routes/index.tsx b/routes/index.tsx
index 8022ee2..1f584f5 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -5,6 +5,7 @@ import { Helmet } from "react-helmet"
export default function Home() {
return (
+<>
+
+
+
+>
);
}
From e1037de53dc864efc3a1903de1f48d17af242ada Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:52:03 +0900
Subject: [PATCH 28/48] Revert "Try removing a {} from JS codes"
This reverts commit 1d654f9d71a5e96c806c4a590efba2bd210a0e69.
---
routes/index.tsx | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/routes/index.tsx b/routes/index.tsx
index 1f584f5..9e659b8 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -23,13 +23,16 @@ export default function Home() {
>
From 3ee7302b7c9e73088f3ec36bd58bd315f8d21eee Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:52:41 +0900
Subject: [PATCH 29/48] Revert "Try not using variable in JS codes"
This reverts commit 507570c63e7e70bfc8d65e16262dc107fa4303cb.
---
routes/index.tsx | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/routes/index.tsx b/routes/index.tsx
index 9e659b8..27560c2 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -24,14 +24,16 @@ export default function Home() {
From d0f59dc8522d27f6e3ecff6c0c6b19b97bb99267 Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:52:59 +0900
Subject: [PATCH 30/48] Revert "Try separating var"
This reverts commit 8d4725c57ebac22d4fa5d4c84ba8f3b0df1f9989.
---
routes/index.tsx | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/routes/index.tsx b/routes/index.tsx
index 27560c2..3c02fcb 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -24,8 +24,7 @@ export default function Home() {
-
+
>
);
From 21a0576bd393914b1aeba324764fa6afb32fccef Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:53:36 +0900
Subject: [PATCH 33/48] Revert "Add back origianl deno test and try a new HTML
format"
This reverts commit 32ef88b07e560def841f8cba9c41792b3e32c247.
---
.github/workflows/ci.yml | 6 ------
routes/index.tsx | 28 ++++++++++++++--------------
2 files changed, 14 insertions(+), 20 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d240cac..96a43fb 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -27,12 +27,6 @@ jobs:
with:
deno-version: v1.x
- - name: Format
- run: deno fmt --check
-
- - name: Lint
- run: deno lint
-
- name: Run the app locally
run: deno task dev &
diff --git a/routes/index.tsx b/routes/index.tsx
index 17df5b7..70aedc2 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -3,7 +3,7 @@ import { h } from "preact";
export default function Home() {
return (
-<>
+<>
-
+
+
>
);
From a178c1d78eec25323e36d495800f3441c24cbde9 Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:53:45 +0900
Subject: [PATCH 34/48] Revert "Try removing deno lint"
This reverts commit ccb293c854ac0b7bf11c05d98f7ff2a09a471513.
---
.github/workflows/ci.yml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 96a43fb..f991c4b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -26,6 +26,9 @@ jobs:
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
+
+ - name: Lint
+ run: deno lint
- name: Run the app locally
run: deno task dev &
From 9e8d849dc3a168de5ce72dbbbc8dc2c4b4da24d3 Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:53:52 +0900
Subject: [PATCH 35/48] Revert "Try removing format check"
This reverts commit 3f8793428efc89e6283f924bc309deb1d75289ec.
---
.github/workflows/ci.yml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f991c4b..d240cac 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -26,7 +26,10 @@ jobs:
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
-
+
+ - name: Format
+ run: deno fmt --check
+
- name: Lint
run: deno lint
From 94de0f4cef4baa556cf0a547d219b2eda154a3c5 Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:54:02 +0900
Subject: [PATCH 36/48] Revert "Try a possible way to remove "error: Unexpected
token "div". Expected jsx identifier""
This reverts commit edabb85b01cd14c36b6e7cd1cc147dd16c4814a5.
---
routes/index.tsx | 2 --
1 file changed, 2 deletions(-)
diff --git a/routes/index.tsx b/routes/index.tsx
index 70aedc2..db4167b 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -3,7 +3,6 @@ import { h } from "preact";
export default function Home() {
return (
-<>
->
);
}
From 7fb8a3b0b8094c17076c718ee876c1ff3e942ab3 Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:54:10 +0900
Subject: [PATCH 37/48] Revert "Format HTML & JS codes"
This reverts commit afab101cf7d381246f1d3db8744804d518edafdb.
---
routes/index.tsx | 57 +++++++++++++++++++++++++-----------------------
1 file changed, 30 insertions(+), 27 deletions(-)
diff --git a/routes/index.tsx b/routes/index.tsx
index db4167b..01c2f52 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -3,34 +3,37 @@ import { h } from "preact";
export default function Home() {
return (
-
-
-
-
-
- Skill Test (Software Engineer)
-
-
-
-
-
-
-
+
+
+
);
}
From 7fa178e96a857d76152caac1550339cab22be0c5 Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:54:23 +0900
Subject: [PATCH 38/48] Revert "Modify index file based on text.ts _01"
This reverts commit a58a6299e9571ff8b67157fe111b68eee4092e0d.
---
routes/index.tsx | 21 ---------------------
1 file changed, 21 deletions(-)
diff --git a/routes/index.tsx b/routes/index.tsx
index 01c2f52..6071486 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -13,27 +13,6 @@ export default function Home() {
Skill Test (Software Engineer)
-
-
-
-
-
-
-
-
-
);
}
From c4b48615c2856c83b6836fee646186999bf409c1 Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 13:57:36 +0900
Subject: [PATCH 39/48] Add back p and button to index.tsx
---
routes/index.tsx | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/routes/index.tsx b/routes/index.tsx
index 6071486..3bc137a 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -13,6 +13,10 @@ export default function Home() {
Skill Test (Software Engineer)
+
+
+
+
);
}
From 61111fc0b237f061778b1ed3cfd6dcfe9771392c Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 14:07:43 +0900
Subject: [PATCH 40/48] Try removing input
---
routes/index.tsx | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/routes/index.tsx b/routes/index.tsx
index 3bc137a..c3d7827 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -13,9 +13,7 @@ export default function Home() {
Skill Test (Software Engineer)
-
-
-
+
);
From e1abfe33f5ded5dc87f879153466a36f70453f79 Mon Sep 17 00:00:00 2001
From: Alan
Date: Sat, 10 Sep 2022 16:09:08 +0900
Subject: [PATCH 41/48] Implemented the search funcitons based on the test
cases in test.ts
---
fresh.gen.ts | 13 ++++++++++---
islands/search.tsx | 22 ++++++++++++++++++++++
routes/[page].tsx | 16 ++++++++++++++++
routes/index.tsx | 4 ++--
routes/jobs/[job].tsx | 11 +++++++++++
5 files changed, 61 insertions(+), 5 deletions(-)
create mode 100644 islands/search.tsx
create mode 100644 routes/[page].tsx
create mode 100644 routes/jobs/[job].tsx
diff --git a/fresh.gen.ts b/fresh.gen.ts
index 799a93f..5768853 100644
--- a/fresh.gen.ts
+++ b/fresh.gen.ts
@@ -2,13 +2,20 @@
// This file SHOULD be checked into source version control.
// This file is automatically updated during development when running `dev.ts`.
-import * as $0 from "./routes/index.tsx";
+import * as $0 from "./routes/[page].tsx";
+import * as $1 from "./routes/index.tsx";
+import * as $2 from "./routes/jobs/[job].tsx";
+import * as $$0 from "./islands/search.tsx";
const manifest = {
routes: {
- "./routes/index.tsx": $0,
+ "./routes/[page].tsx": $0,
+ "./routes/index.tsx": $1,
+ "./routes/jobs/[job].tsx": $2,
+ },
+ islands: {
+ "./islands/search.tsx": $$0,
},
- islands: {},
baseUrl: import.meta.url,
};
diff --git a/islands/search.tsx b/islands/search.tsx
new file mode 100644
index 0000000..58273fe
--- /dev/null
+++ b/islands/search.tsx
@@ -0,0 +1,22 @@
+/** @jsx h */
+import { h } from "preact";
+import { useEffect, useState } from "preact/hooks";
+
+const search = () => {
+ const [inputValue, setValue] = useState("");
+
+ return (
+
+ setValue(e.target.value)}
+ >
+
+
+
+ );
+};
+export default search;
diff --git a/routes/[page].tsx b/routes/[page].tsx
new file mode 100644
index 0000000..4789bef
--- /dev/null
+++ b/routes/[page].tsx
@@ -0,0 +1,16 @@
+/** @jsx h */
+import { h } from "preact";
+import { Handlers, PageProps } from "$fresh/server.ts";
+import Search from "../islands/search.tsx";
+
+export default function JobPage(props: PageProps) {
+ const jobInfo = (props.params.page.toLowerCase() == "jobs")
+ ? "error: empty input"
+ : "error: page doesn't exist!";
+ return (
+
+ );
+}
diff --git a/routes/index.tsx b/routes/index.tsx
index c3d7827..c67eace 100644
--- a/routes/index.tsx
+++ b/routes/index.tsx
@@ -1,5 +1,6 @@
/** @jsx h */
import { h } from "preact";
+import Search from "../islands/search.tsx";
export default function Home() {
return (
@@ -13,8 +14,7 @@ export default function Home() {
Skill Test (Software Engineer)
-
-
+
);
}
diff --git a/routes/jobs/[job].tsx b/routes/jobs/[job].tsx
new file mode 100644
index 0000000..2b6b4c5
--- /dev/null
+++ b/routes/jobs/[job].tsx
@@ -0,0 +1,11 @@
+/** @jsx h */
+import { h } from "preact";
+import { Handlers, PageProps } from "$fresh/server.ts";
+
+export default function JobPage(props: PageProps) {
+ const jobInput = props.params.job;
+ const jobInfo = jobInput.toLowerCase() == "engineer"
+ ? 'Job "engineer" is open for you!'
+ : "Job " + '"' + jobInput + '"' + " is not available";
+ return {jobInfo}
;
+}
From b2789f19bf41410d4f11e9e29f1a1e06aed8eab6 Mon Sep 17 00:00:00 2001
From: Alan
Date: Sun, 11 Sep 2022 18:47:09 +0900
Subject: [PATCH 42/48] 1. Remove useState in search.tsx which seems not
working in test.ts 2. Fix the issue of not able to get input value in the
last 2 test cases
---
islands/search.tsx | 11 +++++------
routes/[page].tsx | 2 +-
routes/jobs/[job].tsx | 2 +-
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/islands/search.tsx b/islands/search.tsx
index 58273fe..6785eb7 100644
--- a/islands/search.tsx
+++ b/islands/search.tsx
@@ -1,19 +1,18 @@
/** @jsx h */
import { h } from "preact";
-import { useEffect, useState } from "preact/hooks";
const search = () => {
- const [inputValue, setValue] = useState("");
-
return (
setValue(e.target.value)}
+ id="input"
+ />
+
diff --git a/routes/[page].tsx b/routes/[page].tsx
index 4789bef..a878b87 100644
--- a/routes/[page].tsx
+++ b/routes/[page].tsx
@@ -1,6 +1,6 @@
/** @jsx h */
import { h } from "preact";
-import { Handlers, PageProps } from "$fresh/server.ts";
+import { PageProps } from "$fresh/server.ts";
import Search from "../islands/search.tsx";
export default function JobPage(props: PageProps) {
diff --git a/routes/jobs/[job].tsx b/routes/jobs/[job].tsx
index 2b6b4c5..c325b66 100644
--- a/routes/jobs/[job].tsx
+++ b/routes/jobs/[job].tsx
@@ -1,6 +1,6 @@
/** @jsx h */
import { h } from "preact";
-import { Handlers, PageProps } from "$fresh/server.ts";
+import { PageProps } from "$fresh/server.ts";
export default function JobPage(props: PageProps) {
const jobInput = props.params.job;
From e40e902d619cb62cb83497323eac4539648c560c Mon Sep 17 00:00:00 2001
From: Alan
Date: Sun, 11 Sep 2022 19:06:54 +0900
Subject: [PATCH 43/48] Try adding delay(100) for each test case to avoid
"error: AssertionError: Test case is leaking async ops." in CI
---
test.ts | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/test.ts b/test.ts
index 5963282..f9dcbcb 100644
--- a/test.ts
+++ b/test.ts
@@ -1,3 +1,4 @@
+import { delay } from "https://deno.land/std@0.150.0/async/delay.ts";
import { buildFor } from "sinco/mod.ts";
import { assertEquals } from "testing/asserts.ts";
@@ -14,6 +15,7 @@ Deno.test("E2E test", async (t) => {
/* Beginning of tests */
await t.step("click the logo", async () => {
+ await delay(100);
await page.location(index);
const image = await page.querySelector("img");
@@ -25,11 +27,13 @@ Deno.test("E2E test", async (t) => {
await page.location(index);
await t.step("input is empty", async () => {
+ await delay(100);
const input = await page.querySelector("input");
assertEquals(await input.value(), "");
});
await t.step("error is not shown", async () => {
+ await delay(100);
const error = await page.evaluate(() =>
document.querySelector("p")?.innerText
);
@@ -37,6 +41,7 @@ Deno.test("E2E test", async (t) => {
});
await t.step("show error for an empty input", async () => {
+ await delay(100);
const button = await page.querySelector("button");
await button.click({ waitFor: "navigation" });
@@ -47,6 +52,7 @@ Deno.test("E2E test", async (t) => {
});
await t.step("input a random string and click the button", async () => {
+ await delay(100);
const input = await page.querySelector("input");
const name = crypto.randomUUID().slice(0, 7);
@@ -66,6 +72,7 @@ Deno.test("E2E test", async (t) => {
await page.location(index);
await t.step("input 'engineer' and click the button", async () => {
+ await delay(100);
const input = await page.querySelector("input");
await input.value("engineer");
From 452aa2a11f3502f08170b31e398ea09138e92aa3 Mon Sep 17 00:00:00 2001
From: Alan
Date: Sun, 11 Sep 2022 19:16:27 +0900
Subject: [PATCH 44/48] Remove delay(100) in test.ts and add --trace-ops to ci
for debugging
---
.github/workflows/ci.yml | 2 +-
test.ts | 7 -------
2 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d240cac..1ffbfd6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -37,4 +37,4 @@ jobs:
run: deno task dev &
- name: Test
- run: deno task start && CHROME_BIN=$(which chrome) deno task test --quiet
+ run: deno task start && CHROME_BIN=$(which chrome) deno task test --quiet --trace-ops
diff --git a/test.ts b/test.ts
index f9dcbcb..5963282 100644
--- a/test.ts
+++ b/test.ts
@@ -1,4 +1,3 @@
-import { delay } from "https://deno.land/std@0.150.0/async/delay.ts";
import { buildFor } from "sinco/mod.ts";
import { assertEquals } from "testing/asserts.ts";
@@ -15,7 +14,6 @@ Deno.test("E2E test", async (t) => {
/* Beginning of tests */
await t.step("click the logo", async () => {
- await delay(100);
await page.location(index);
const image = await page.querySelector("img");
@@ -27,13 +25,11 @@ Deno.test("E2E test", async (t) => {
await page.location(index);
await t.step("input is empty", async () => {
- await delay(100);
const input = await page.querySelector("input");
assertEquals(await input.value(), "");
});
await t.step("error is not shown", async () => {
- await delay(100);
const error = await page.evaluate(() =>
document.querySelector("p")?.innerText
);
@@ -41,7 +37,6 @@ Deno.test("E2E test", async (t) => {
});
await t.step("show error for an empty input", async () => {
- await delay(100);
const button = await page.querySelector("button");
await button.click({ waitFor: "navigation" });
@@ -52,7 +47,6 @@ Deno.test("E2E test", async (t) => {
});
await t.step("input a random string and click the button", async () => {
- await delay(100);
const input = await page.querySelector("input");
const name = crypto.randomUUID().slice(0, 7);
@@ -72,7 +66,6 @@ Deno.test("E2E test", async (t) => {
await page.location(index);
await t.step("input 'engineer' and click the button", async () => {
- await delay(100);
const input = await page.querySelector("input");
await input.value("engineer");
From 913b8968fecb5e5d92384528f476e0c2b31281ed Mon Sep 17 00:00:00 2001
From: Shun Ueda
Date: Thu, 8 Sep 2022 08:03:02 +0900
Subject: [PATCH 45/48] Update README.md
---
README.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/README.md b/README.md
index 32e4a43..a4c3538 100644
--- a/README.md
+++ b/README.md
@@ -3,14 +3,14 @@
## Problem
Make changes on the project to pass CI on GitHub Actions, without modifying or
-removing any lines in the original code.
+removing any existing lines in the original code.
> **Warning**\
> You may not refer any other forks or pull-requests of this repository, or ask
> someone for help.
> **Note**\
-> Expected time required: 20-60 min\
+> Expected time required: 30-180 min\
> Expected amount of code added: approx. 30 lines
## Submission
@@ -32,7 +32,7 @@ Feel free to submit an uncompleted work and ask questions there.
Application:
- Language: [TypeScript](https://www.typescriptlang.org/)
-- Runtime: [Deno](https://deno.land/) (latest)
+- Runtime: [Deno](https://deno.land/)
- Framework: [Fresh](https://fresh.deno.dev/)
DevOps:
@@ -41,11 +41,11 @@ DevOps:
- CI/CD: [GitHub Actions](https://github.co.jp/features/actions)
- E2E Test: [Sinco](https://drash.land/sinco/)
+This does not necessarily reflect those in our real applications.
+
**You are not expected to be experienced with all of these**, but expected to be
able to learn them quickly by yourself if needed.
-**The stack above includes techs that we don't use in our real applications.**
-
### Run the app locally
```sh
From 3a2cbd7faec432b194a062bdcee87b112403994a Mon Sep 17 00:00:00 2001
From: Shun Ueda
Date: Mon, 12 Sep 2022 15:54:09 +0900
Subject: [PATCH 46/48] Fix the version of Deno
---
.github/workflows/ci.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 1ffbfd6..100bf97 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -25,7 +25,7 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
- deno-version: v1.x
+ deno-version: v1.24.3
- name: Format
run: deno fmt --check
From b12b3aca6253e3ae3d7290beb55fc3757bee2ecf Mon Sep 17 00:00:00 2001
From: Alan
Date: Thu, 8 Sep 2022 10:49:36 +0900
Subject: [PATCH 47/48] Try removing format check
---
.github/workflows/ci.yml | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 100bf97..524a411 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -25,11 +25,8 @@ jobs:
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
- deno-version: v1.24.3
-
- - name: Format
- run: deno fmt --check
-
+ deno-version: v1.x
+
- name: Lint
run: deno lint
From f13f713c6e2eeb2966fc8f800df29637fb5e41e9 Mon Sep 17 00:00:00 2001
From: Alan
Date: Mon, 12 Sep 2022 20:29:37 +0900
Subject: [PATCH 48/48] Add back "Run the app locally"
---
.github/workflows/ci.yml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index db3084d..f8280dd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -33,5 +33,8 @@ jobs:
- name: Lint
run: deno lint
+ - name: Run the app locally
+ run: deno task dev &
+
- name: Test
run: deno task start && CHROME_BIN=$(which chrome) deno task test --quiet