-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
16 additions
and
8 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 |
---|---|---|
|
@@ -30,3 +30,6 @@ jobs: | |
|
||
- name: Lint | ||
run: deno lint | ||
|
||
- name: Test | ||
run: deno test -A |
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,7 +1,4 @@ | ||
import { | ||
assert, | ||
assertEquals, | ||
} from "https://deno.land/[email protected]/testing/asserts.ts"; | ||
import { assert } from "https://deno.land/[email protected]/testing/asserts.ts"; | ||
|
||
Deno.test({ | ||
name: "Able to build the current project", | ||
|
@@ -30,13 +27,21 @@ Deno.test({ | |
}); | ||
|
||
await new Promise<void>((resolve) => { | ||
setTimeout(() => { | ||
resolve(); | ||
}, 600); | ||
const check_if_port_is_open = async () => { | ||
try { | ||
const { status } = await fetch("http://localhost:4507/mononykus/", { | ||
method: "HEAD", | ||
}); | ||
if (status === 200) resolve(); | ||
} catch (_) { | ||
setTimeout(check_if_port_is_open, 60); | ||
} | ||
}; | ||
return check_if_port_is_open(); | ||
}); | ||
|
||
const response = await fetch("http://localhost:4507/mononykus/"); | ||
assertEquals(response.status, 200); | ||
|
||
const html = await response.text(); | ||
|
||
process.kill(); | ||
|