Skip to content
This repository was archived by the owner on Jun 18, 2024. It is now read-only.

alanmih #5

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
cb567d5
Add alanci.yml as the test requested
alanmih Sep 6, 2022
c4fde93
Add a parameter to the CI test step
alanmih Sep 7, 2022
86729d4
Try removing the codes under "name: Test" which could cause error
alanmih Sep 7, 2022
fb362b1
Try changing the first character of Steps into lower case
alanmih Sep 7, 2022
d113d23
Try adding "deno task start"
alanmih Sep 7, 2022
1275a57
Try add back "CHROME_BIN=$(which chrome) deno task test --quiet"
alanmih Sep 7, 2022
5d879e2
Try adding "deno task dev" before the last test step
alanmih Sep 7, 2022
f5988b9
Remove alanci.yml and add a timeout parameter to ci.yml
alanmih Sep 7, 2022
f375589
Set the timeout for "Run the app locally"
alanmih Sep 7, 2022
c6913b9
Try with slepp 5 seconds after starting an instance
alanmih Sep 7, 2022
c0a7e4b
Test adding curl after "deno task dev"
alanmih Sep 7, 2022
024e3b0
Try adding &
alanmih Sep 7, 2022
a58a629
Modify index file based on text.ts _01
alanmih Sep 8, 2022
afab101
Format HTML & JS codes
alanmih Sep 8, 2022
edabb85
Try a possible way to remove "error: Unexpected token "div". Expected…
alanmih Sep 8, 2022
3f87934
Try removing format check
alanmih Sep 8, 2022
ccb293c
Try removing deno lint
alanmih Sep 8, 2022
32ef88b
Add back origianl deno test and try a new HTML format
alanmih Sep 8, 2022
87e890e
Try using React Helmet for including JS codes
alanmih Sep 8, 2022
79c21f8
Add ;
alanmih Sep 8, 2022
8d4725c
Try separating var
alanmih Sep 8, 2022
507570c
Try not using variable in JS codes
alanmih Sep 8, 2022
1d654f9
Try removing a {} from JS codes
alanmih Sep 8, 2022
6aa4044
Try removing all JS codes
alanmih Sep 8, 2022
eae1076
Revert index.tsx
alanmih Sep 8, 2022
a52d100
Revert "Revert index.tsx"
alanmih Sep 8, 2022
cc68ba3
Revert "Try removing all JS codes"
alanmih Sep 8, 2022
e1037de
Revert "Try removing a {} from JS codes"
alanmih Sep 8, 2022
3ee7302
Revert "Try not using variable in JS codes"
alanmih Sep 8, 2022
d0f59dc
Revert "Try separating var"
alanmih Sep 8, 2022
59adf5f
Revert "Add ;"
alanmih Sep 8, 2022
558e4c6
Revert "Try using React Helmet for including JS codes"
alanmih Sep 8, 2022
21a0576
Revert "Add back origianl deno test and try a new HTML format"
alanmih Sep 8, 2022
a178c1d
Revert "Try removing deno lint"
alanmih Sep 8, 2022
9e8d849
Revert "Try removing format check"
alanmih Sep 8, 2022
94de0f4
Revert "Try a possible way to remove "error: Unexpected token "div". …
alanmih Sep 8, 2022
7fb8a3b
Revert "Format HTML & JS codes"
alanmih Sep 8, 2022
7fa178e
Revert "Modify index file based on text.ts _01"
alanmih Sep 8, 2022
c4b4861
Add back p and button to index.tsx
alanmih Sep 8, 2022
61111fc
Try removing input
alanmih Sep 8, 2022
e1abfe3
Implemented the search funcitons based on the test cases in test.ts
alanmih Sep 10, 2022
b2789f1
1. Remove useState in search.tsx which seems not working in test.ts
alanmih Sep 11, 2022
e40e902
Try adding delay(100) for each test case to avoid "error: AssertionEr…
alanmih Sep 11, 2022
452aa2a
Remove delay(100) in test.ts and add --trace-ops to ci for debugging
alanmih Sep 11, 2022
913b896
Update README.md
hasundue Sep 7, 2022
3a2cbd7
Fix the version of Deno
hasundue Sep 12, 2022
b12b3ac
Try removing format check
alanmih Sep 8, 2022
3bbffe6
Rebase to include the reent changes in ac-test
alanmih Sep 12, 2022
f13f713
Add back "Run the app locally"
alanmih Sep 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 10 additions & 3 deletions fresh.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};

Expand Down
21 changes: 21 additions & 0 deletions islands/search.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/** @jsx h */
import { h } from "preact";

const search = () => {
return (
<div>
<input
type="text"
placeholder="search a job"
id="input"
/>
<button
onClick={() =>
location.replace("/jobs/" + document.getElementById("input").value)}
>
Search
</button>
</div>
);
};
export default search;
16 changes: 16 additions & 0 deletions routes/[page].tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/** @jsx h */
import { h } from "preact";
import { 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 (
<div>
<p>{jobInfo}</p>
<Search />
</div>
);
}
2 changes: 2 additions & 0 deletions routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/** @jsx h */
import { h } from "preact";
import Search from "../islands/search.tsx";

export default function Home() {
return (
Expand All @@ -13,6 +14,7 @@ export default function Home() {
<h2>
Skill Test (Software Engineer)
</h2>
<Search />
</div>
);
}
11 changes: 11 additions & 0 deletions routes/jobs/[job].tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/** @jsx h */
import { h } from "preact";
import { 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 <div>{jobInfo}</div>;
}