Skip to content

Commit

Permalink
upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
digitaldesigndj committed Aug 16, 2023
1 parent 209f692 commit 8a33626
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
# uses: denoland/setup-deno@v1
uses: denoland/setup-deno@v1
with:
deno-version: v1.35.2
deno-version: v1.36.1

- name: Verify formatting
run: deno fmt --check
Expand Down
10 changes: 6 additions & 4 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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]",
Expand Down
32 changes: 17 additions & 15 deletions fresh.gen.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// DO NOT EDIT. This file is generated by fresh.
// DO NOT EDIT. This file is generated by Fresh.
// 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/_404.jsx"
import * as $1 from "./routes/_500.jsx"
import * as $2 from "./routes/_middleware.js"
import * as $3 from "./routes/index.jsx"
import * as $4 from "./routes/pages/[slug].jsx"
import * as $5 from "./routes/pages/index.jsx"
import * as $6 from "./routes/showcase.jsx"
import * as $7 from "./routes/sitemap.xml.js"
import * as $8 from "./routes/uploads/[file].js"
import * as $2 from "./routes/_app.tsx"
import * as $3 from "./routes/_middleware.js"
import * as $4 from "./routes/index.jsx"
import * as $5 from "./routes/pages/[slug].jsx"
import * as $6 from "./routes/pages/index.jsx"
import * as $7 from "./routes/showcase.jsx"
import * as $8 from "./routes/sitemap.xml.js"
import * as $9 from "./routes/uploads/[file].js"
import * as $$0 from "./islands/SingleImagePopup.jsx"
import * as $$1 from "./islands/Slideshow.tsx"
import * as $$2 from "./islands/ThumbnailGallery.tsx"
Expand All @@ -19,13 +20,14 @@ const manifest = {
routes: {
"./routes/_404.jsx": $0,
"./routes/_500.jsx": $1,
"./routes/_middleware.js": $2,
"./routes/index.jsx": $3,
"./routes/pages/[slug].jsx": $4,
"./routes/pages/index.jsx": $5,
"./routes/showcase.jsx": $6,
"./routes/sitemap.xml.js": $7,
"./routes/uploads/[file].js": $8,
"./routes/_app.tsx": $2,
"./routes/_middleware.js": $3,
"./routes/index.jsx": $4,
"./routes/pages/[slug].jsx": $5,
"./routes/pages/index.jsx": $6,
"./routes/showcase.jsx": $7,
"./routes/sitemap.xml.js": $8,
"./routes/uploads/[file].js": $9,
},
islands: {
"./islands/SingleImagePopup.jsx": $$0,
Expand Down
16 changes: 16 additions & 0 deletions routes/_app.tsx
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>
)
}
46 changes: 46 additions & 0 deletions test/4_handler_test.ts
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>"))
})
}),
)

0 comments on commit 8a33626

Please sign in to comment.