Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
digitaldesigndj committed Aug 23, 2023
1 parent ad11dfb commit 3a3c854
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 28 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.36.1
deno-version: v1.x

- name: Verify formatting
run: deno fmt --check
Expand Down
14 changes: 10 additions & 4 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@
"jsxImportSource": "preact"
},
"fmt": {
"semiColons": false
"semiColons": false,
"exclude": [
"_fresh"
]
},
"lock": false,
"imports": {
"@/": "./",
"$fresh/": "https://deno.land/x/[email protected].1/",
"$fresh/": "https://deno.land/x/[email protected].2/",
"$std/": "https://deno.land/[email protected]/",
"$icons/": "https://deno.land/x/[email protected]/tsx/",
"fresh_seo": "https://deno.land/x/[email protected]/mod.ts",
Expand All @@ -39,6 +42,9 @@
"fresh",
"recommended"
]
}
},
"exclude": [
"_fresh"
]
}
}
}
25 changes: 2 additions & 23 deletions test/4_fetch_test_wrapper.ts → test/4_fetch_test_also.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,8 @@
import { delay } from "$std/async/delay.ts"
import { startFreshServer } from "$fresh/tests/test_utils.ts"
import { BASE_URL } from "@/utils/config.js"
import { fetchTestWrapper } from "@/test/fetch_test_wrapper.ts"
import { assert, assertEquals } from "$std/assert/mod.ts"
import { Status } from "$std/http/http_status.ts"
import { DOMParser } from "https://deno.land/x/deno_dom/deno-dom-wasm.ts"

const myTestWrapper =
(args: string[]) => (theTests: any) => async (t: Deno.TestContext) => {
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 fetchTestWrapper = myTestWrapper([
"run",
"-A",
"--unstable",
"./main.ts",
])
import { BASE_URL } from "@/utils/config.js"

Deno.test(
"The index page works",
Expand Down
22 changes: 22 additions & 0 deletions test/fetch_test_wrapper.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { delay } from "$std/async/delay.ts"
import { startFreshServer } from "$fresh/tests/test_utils.ts"

const myTestWrapper =
(args: string[]) => (theTests: any) => async (t: Deno.TestContext) => {
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 fetchTestWrapper = myTestWrapper([
"run",
"-A",
"--unstable",
"./main.ts",
])

0 comments on commit 3a3c854

Please sign in to comment.