-
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
1 parent
209f692
commit 8a33626
Showing
5 changed files
with
86 additions
and
20 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
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 |
---|---|---|
|
@@ -2,7 +2,9 @@ | |
"tasks": { | ||
"start": "deno run -A --unstable --watch=static/,routes/ dev.ts", | ||
"run": "DENO_DEPLOYMENT_ID=$(git rev-parse --short HEAD) deno run -A --unstable main.ts", | ||
"test": "deno test -A --unstable" | ||
"test": "deno test -A --unstable", | ||
"build": "deno run -A dev.ts build", | ||
"preview": "deno run -A main.ts" | ||
}, | ||
"compilerOptions": { | ||
"jsx": "react-jsx", | ||
|
@@ -14,14 +16,14 @@ | |
"lock": false, | ||
"imports": { | ||
"@/": "./", | ||
"$fresh/": "https://deno.land/x/fresh@1.3.0/", | ||
"$std/": "https://deno.land/std@0.192.0/", | ||
"$fresh/": "https://deno.land/x/fresh@1.4.1/", | ||
"$std/": "https://deno.land/std@0.198.0/", | ||
"$icons/": "https://deno.land/x/[email protected]/tsx/", | ||
"fresh_seo": "https://deno.land/x/[email protected]/mod.ts", | ||
"fresh_marionette": "https://deno.land/x/[email protected]/mod.js", | ||
"preact": "https://esm.sh/[email protected]", | ||
"preact/": "https://esm.sh/[email protected]/", | ||
"preact-render-to-string": "https://esm.sh/*[email protected].0", | ||
"preact-render-to-string": "https://esm.sh/*[email protected].1", | ||
"@preact/signals": "https://esm.sh/*@preact/[email protected]", | ||
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]", | ||
"twind": "https://esm.sh/[email protected]", | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { AppProps } from "$fresh/server.ts" | ||
|
||
export default function App({ Component }: AppProps) { | ||
return ( | ||
<html> | ||
<head> | ||
<meta charSet="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>hyprtxt.deno.dev</title> | ||
</head> | ||
<body> | ||
<Component /> | ||
</body> | ||
</html> | ||
) | ||
} |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// import { createHandler } from "$fresh/server.ts" | ||
// import manifest from "@/fresh.gen.ts" | ||
import { delay } from "$std/async/delay.ts" | ||
import { startFreshServer } from "$fresh/tests/test_utils.ts" | ||
|
||
import { BASE_URL } from "@/utils/config.js" | ||
import { assert, assertEquals } from "$std/assert/mod.ts" | ||
import { Status } from "$std/http/http_status.ts" | ||
|
||
const myTestWrapper = (args: any) => (theTests: any) => async (t: any) => { | ||
const { serverProcess, lines } = await startFreshServer({ | ||
args, | ||
}) | ||
await theTests(t) | ||
// Stop the Server | ||
await lines.cancel() | ||
serverProcess.kill("SIGTERM") | ||
// await for the server to close | ||
await delay(100) | ||
} | ||
|
||
export const fixtureTestWrapper = myTestWrapper([ | ||
"run", | ||
"-A", | ||
"--unstable", | ||
"./main.ts", | ||
]) | ||
|
||
// import { wrapFetch } from "cookiejar"; | ||
// const fetch = wrapFetch(); | ||
|
||
Deno.test( | ||
"The Dashboard should show a new login", | ||
{ | ||
sanitizeResources: false, | ||
sanitizeOps: false, | ||
}, | ||
fixtureTestWrapper(async (t: any) => { | ||
await t.step("The dashboard shows nothing", async () => { | ||
const response = await fetch(`${BASE_URL}`) | ||
assertEquals(response.status, Status.OK) | ||
const text = await response.text() | ||
assert(!text.includes("<div>Flashed message: test</div>")) | ||
}) | ||
}), | ||
) |