diff --git a/runtime_tests/deno-jsx/deno.precompile.json b/runtime_tests/deno-jsx/deno.precompile.json index d46d3718..3bd2b8f3 100644 --- a/runtime_tests/deno-jsx/deno.precompile.json +++ b/runtime_tests/deno-jsx/deno.precompile.json @@ -12,6 +12,7 @@ "sloppy-imports" ], "imports": { + "@std/assert": "jsr:@std/assert@^1.0.3", "hono/jsx/jsx-runtime": "../../src/jsx/jsx-runtime.ts" } } \ No newline at end of file diff --git a/runtime_tests/deno-jsx/deno.react-jsx.json b/runtime_tests/deno-jsx/deno.react-jsx.json index 92e4f772..0d549bcc 100644 --- a/runtime_tests/deno-jsx/deno.react-jsx.json +++ b/runtime_tests/deno-jsx/deno.react-jsx.json @@ -12,6 +12,7 @@ "sloppy-imports" ], "imports": { + "@std/assert": "jsr:@std/assert@^1.0.3", "hono/jsx/jsx-runtime": "../../src/jsx/jsx-runtime.ts" } } \ No newline at end of file diff --git a/runtime_tests/deno-jsx/jsx.test.tsx b/runtime_tests/deno-jsx/jsx.test.tsx index d4883b50..f537d58b 100644 --- a/runtime_tests/deno-jsx/jsx.test.tsx +++ b/runtime_tests/deno-jsx/jsx.test.tsx @@ -3,7 +3,7 @@ import { Style, css } from '../../src/helper/css/index.ts' import { Suspense, renderToReadableStream } from '../../src/jsx/streaming.ts' import type { HtmlEscapedString } from '../../src/utils/html.ts' import { HtmlEscapedCallbackPhase, resolveCallback } from '../../src/utils/html.ts' -import { assertEquals } from '../deno/deps.ts' +import { assertEquals } from '@std/assert' Deno.test('JSX', () => { const Component = ({ name }: { name: string }) => {name} diff --git a/runtime_tests/deno/deno.json b/runtime_tests/deno/deno.json index 92e4f772..240c5d2e 100644 --- a/runtime_tests/deno/deno.json +++ b/runtime_tests/deno/deno.json @@ -12,6 +12,8 @@ "sloppy-imports" ], "imports": { + "@std/assert": "jsr:@std/assert@^1.0.3", + "@std/testing": "jsr:@std/testing@^1.0.1", "hono/jsx/jsx-runtime": "../../src/jsx/jsx-runtime.ts" } -} \ No newline at end of file +} diff --git a/runtime_tests/deno/deno.lock b/runtime_tests/deno/deno.lock index 7d709ff2..49d0b042 100644 --- a/runtime_tests/deno/deno.lock +++ b/runtime_tests/deno/deno.lock @@ -2,20 +2,33 @@ "version": "3", "packages": { "specifiers": { - "npm:@types/node": "npm:@types/node@18.16.19" + "jsr:@std/assert@^1.0.3": "jsr:@std/assert@1.0.3", + "jsr:@std/internal@^1.0.2": "jsr:@std/internal@1.0.2", + "jsr:@std/testing@^1.0.1": "jsr:@std/testing@1.0.1" }, - "npm": { - "@types/node@18.16.19": { - "integrity": "sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==", - "dependencies": {} + "jsr": { + "@std/assert@1.0.3": { + "integrity": "b0d03ce1ced880df67132eea140623010d415848df66f6aa5df76507ca7c26d8", + "dependencies": [ + "jsr:@std/internal@^1.0.2" + ] + }, + "@std/internal@1.0.2": { + "integrity": "f4cabe2021352e8bfc24e6569700df87bf070914fc38d4b23eddd20108ac4495" + }, + "@std/testing@1.0.1": { + "integrity": "9c25841137ee818933e1722091bb9ed5fdc251c35e84c97979a52196bdb6c5c3", + "dependencies": [ + "jsr:@std/assert@^1.0.3" + ] } } }, - "remote": { - "https://deno.land/std@0.147.0/fmt/colors.ts": "6f9340b7fb8cc25a993a99e5efc56fe81bb5af284ff412129dd06df06f53c0b4", - "https://deno.land/std@0.147.0/testing/_diff.ts": "029a00560b0d534bc0046f1bce4bd36b3b41ada3f2a3178c85686eb2ff5f1413", - "https://deno.land/std@0.147.0/testing/_format.ts": "0d8dc79eab15b67cdc532826213bbe05bccfd276ca473a50a3fc7bbfb7260642", - "https://deno.land/std@0.147.0/testing/asserts.ts": "c17254748504f449c98476b78f4d206ca47cffc826e415026f09d7600c19535e", - "https://deno.land/std@0.147.0/testing/mock.ts": "d9630b551fe59a81b3c214c1a6ccb67819b6e34fc20e3424a659528fe1f572c1" + "remote": {}, + "workspace": { + "dependencies": [ + "jsr:@std/assert@^1.0.3", + "jsr:@std/testing@^1.0.1" + ] } } diff --git a/runtime_tests/deno/deps.ts b/runtime_tests/deno/deps.ts deleted file mode 100644 index 22cb4455..00000000 --- a/runtime_tests/deno/deps.ts +++ /dev/null @@ -1,2 +0,0 @@ -export { assert, assertEquals, assertMatch } from 'https://deno.land/std@0.147.0/testing/asserts.ts' -export { assertSpyCall, assertSpyCalls, spy } from 'https://deno.land/std@0.147.0/testing/mock.ts' diff --git a/runtime_tests/deno/hono.test.ts b/runtime_tests/deno/hono.test.ts index b66d099b..5543165a 100644 --- a/runtime_tests/deno/hono.test.ts +++ b/runtime_tests/deno/hono.test.ts @@ -1,7 +1,7 @@ import { Context } from '../../src/context.ts' import { env, getRuntimeKey } from '../../src/helper/adapter/index.ts' import { Hono } from '../../src/hono.ts' -import { assertEquals } from './deps.ts' +import { assertEquals } from '@std/assert' // Test just only minimal patterns. // Because others are tested well in Cloudflare Workers environment already. diff --git a/runtime_tests/deno/middleware.test.tsx b/runtime_tests/deno/middleware.test.tsx index aed22e28..6970941e 100644 --- a/runtime_tests/deno/middleware.test.tsx +++ b/runtime_tests/deno/middleware.test.tsx @@ -2,7 +2,8 @@ import { serveStatic } from '../../src/adapter/deno/index.ts' import { Hono } from '../../src/hono.ts' import { basicAuth } from '../../src/middleware/basic-auth/index.ts' import { jwt } from '../../src/middleware/jwt/index.ts' -import { assertEquals, assertMatch, assertSpyCall, assertSpyCalls, spy } from './deps.ts' +import { assertSpyCall, assertSpyCalls, spy } from '@std/testing/mock' +import { assertEquals, assertMatch } from '@std/assert' // Test just only minimal patterns. // Because others are already tested well in Cloudflare Workers environment. diff --git a/runtime_tests/deno/ssg.test.tsx b/runtime_tests/deno/ssg.test.tsx index 18d25733..74cd4e7a 100644 --- a/runtime_tests/deno/ssg.test.tsx +++ b/runtime_tests/deno/ssg.test.tsx @@ -1,6 +1,6 @@ import { toSSG } from '../../src/adapter/deno/ssg.ts' import { Hono } from '../../src/hono.ts' -import { assertEquals } from '../deno/deps.ts' +import { assertEquals } from '@std/assert' Deno.test('toSSG function', async () => { const app = new Hono() diff --git a/runtime_tests/deno/stream.test.ts b/runtime_tests/deno/stream.test.ts index 67eb1a4c..15093f85 100644 --- a/runtime_tests/deno/stream.test.ts +++ b/runtime_tests/deno/stream.test.ts @@ -1,12 +1,12 @@ import { Hono } from '../../src/hono.ts' -import { assertEquals } from './deps.ts' import { stream, streamSSE } from '../../src/helper/streaming/index.ts' +import { assertEquals } from '@std/assert' Deno.test('Shuld call onAbort via stream', async () => { const app = new Hono() let aborted = false app.get('/stream', (c) => { - return stream(c, async (stream) => { + return stream(c, (stream) => { stream.onAbort(() => { aborted = true }) @@ -21,7 +21,6 @@ Deno.test('Shuld call onAbort via stream', async () => { const req = new Request(`http://localhost:${server.addr.port}/stream`, { signal: ac.signal, }) - assertEquals const res = fetch(req).catch(() => {}) assertEquals(aborted, false) await new Promise((resolve) => setTimeout(resolve, 10)) @@ -59,7 +58,7 @@ Deno.test('Shuld call onAbort via streamSSE', async () => { const app = new Hono() let aborted = false app.get('/stream', (c) => { - return streamSSE(c, async (stream) => { + return streamSSE(c, (stream) => { stream.onAbort(() => { aborted = true })