diff --git a/cmd/test/plug_run.test.ts b/cmd/test/plug_run.test.ts deleted file mode 100644 index 49f12335..00000000 --- a/cmd/test/plug_run.test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { AssetBundle } from "$lib/asset_bundle/bundle.ts"; -import { compileManifest } from "../compile.ts"; -import * as esbuild from "esbuild"; -import assets from "../../dist/plug_asset_bundle.json" with { type: "json" }; -import { assertEquals } from "@std/assert"; -import { dirname, join } from "@std/path"; -import { MemoryKvPrimitives } from "$lib/data/memory_kv_primitives.ts"; -import { runPlug } from "../plug_run.ts"; -import { fileURLToPath } from "node:url"; - -Deno.test("Test plug run", { - sanitizeResources: false, - sanitizeOps: false, -}, async () => { - const assetBundle = new AssetBundle(assets); - - const testFolder = dirname(fileURLToPath(new URL(import.meta.url))); - const testSpaceFolder = join(testFolder, "test_space"); - - const plugFolder = join(testSpaceFolder, "_plug"); - await Deno.mkdir(plugFolder, { recursive: true }); - await Deno.writeFile( - `${testSpaceFolder}/SETTINGS.md`, - new TextEncoder().encode("```space-config\nindexPage: index\n```"), - ); - - await compileManifest( - join(testFolder, "test_plug_run.plug.yaml"), - plugFolder, - { - configPath: fileURLToPath(new URL("../../deno.json", import.meta.url)), - }, - ); - assertEquals( - await runPlug( - testSpaceFolder, - "test.run", - [], - assetBundle, - new MemoryKvPrimitives(), - ), - "Hello", - ); - - // await Deno.remove(tempDir, { recursive: true }); - esbuild.stop(); -}); diff --git a/cmd/test/runtime.test.ts b/cmd/test/runtime.test.ts index aee9f02d..4896b5a2 100644 --- a/cmd/test/runtime.test.ts +++ b/cmd/test/runtime.test.ts @@ -47,7 +47,7 @@ Deno.test("Run a deno sandbox", { assertEquals({ addedNumbers: 3, - yamlMessage: "hello: world\n", + jsonMessage: JSON.stringify({ hello: "world" }), }, await plug.invoke("boot", [])); await system.unloadAll(); diff --git a/cmd/test/test_func.test.ts b/cmd/test/test_func.test.ts index 47094da9..64fb77ca 100644 --- a/cmd/test/test_func.test.ts +++ b/cmd/test/test_func.test.ts @@ -1,10 +1,10 @@ -import * as YAML from "js-yaml"; +// import * as YAML from "js-yaml"; export async function hello() { // @ts-ignore: syscall is a global function const numbers = await syscall("addNumbers", 1, 2); return { - yamlMessage: YAML.dump({ hello: "world" }), + jsonMessage: JSON.stringify({ hello: "world" }), addedNumbers: numbers, }; } diff --git a/deno.json b/deno.json index 72254ff1..e22da700 100644 --- a/deno.json +++ b/deno.json @@ -143,7 +143,7 @@ "denosass": "https://deno.land/x/denosass@1.0.6/mod.ts", "djwt": "https://deno.land/x/djwt@v3.0.2/mod.ts", "esbuild": "https://deno.land/x/esbuild@v0.20.2/mod.js", - "fake-indexeddb/": "https://esm.sh/fake-indexeddb@4.0.2/", + "fake-indexeddb/auto": "npm:fake-indexeddb@6.0.0/auto", "fast-diff": "https://esm.sh/fast-diff@1.3.0", "fuse": "https://deno.land/x/fuse@v6.4.1/dist/fuse.esm.min.js", "gitignore-parser": "https://esm.sh/gitignore-parser@0.0.2",