diff --git a/example/deps.ts b/example/deps.ts index 975e5890..63357ab9 100644 --- a/example/deps.ts +++ b/example/deps.ts @@ -1,11 +1,7 @@ -// FIXME there are no releases of dynamodb atm. -// export { createClient, Doc, DynamoDBClient } from "https://deno.land/x/dynamodb/mod.ts"; -// We require a patched version of dynamodb to support temporary session tokens: -// https://github.com/chiefbiiko/dynamodb/pull/3 export { createClient, Doc, DynamoDBClient -} from "https://raw.githubusercontent.com/hayd/dynamodb/782f64ce64e7c83f964970c7eeacba0d5c9dfb91/mod.ts"; +} from "https://deno.land/x/dynamodb@v0.2.0/mod.ts"; -export { v4 as uuid } from "https://deno.land/std@v0.27.0/uuid/mod.ts"; +export { v4 as uuid } from "https://deno.land/std@v0.28.1/uuid/mod.ts"; diff --git a/example/test.ts b/example/test.ts index b0c1c34f..c49ec11a 100644 --- a/example/test.ts +++ b/example/test.ts @@ -4,11 +4,11 @@ // You must also pass a access key/secret environment variables, but these don't have to be real e.g. // AWS_ACCESS_KEY_ID=fakeMyKeyId AWS_SECRET_ACCESS_KEY=fakeSecretAccessKey deno --allow-env --allow-net test.ts -import { runIfMain } from "https://deno.land/std@v0.27.0/testing/mod.ts"; +import { runIfMain } from "https://deno.land/std@v0.28.1/testing/mod.ts"; import { assert, assertEquals -} from "https://deno.land/std@v0.27.0/testing/asserts.ts"; +} from "https://deno.land/std@v0.28.1/testing/asserts.ts"; import { client } from "./client.ts"; import { test } from "./test_util.ts"; diff --git a/example/test_util.ts b/example/test_util.ts index 05181e37..bd332561 100644 --- a/example/test_util.ts +++ b/example/test_util.ts @@ -1,7 +1,7 @@ import { TestDefinition, test as stdTest -} from "https://deno.land/std@v0.27.0/testing/mod.ts"; +} from "https://deno.land/std@v0.28.1/testing/mod.ts"; import { client } from "./client.ts"; import { TableName } from "./api/candidate.ts"; diff --git a/tests/Dockerfile b/tests/Dockerfile index 7cc2dcfd..3d2545f9 100644 --- a/tests/Dockerfile +++ b/tests/Dockerfile @@ -1,6 +1,6 @@ # Note: This must be built in the .. context -FROM hayd/deno:amazonlinux1-0.27.0 +FROM hayd/deno:amazonlinux1-0.28.1 # This is the runtime used by AWS Lambda # plus a compatible deno executable /bin/deno. # https://github.com/hayd/deno_docker diff --git a/tests/deps.ts b/tests/deps.ts index 57f3cf98..9de3d8df 100644 --- a/tests/deps.ts +++ b/tests/deps.ts @@ -1,3 +1,6 @@ -export { assertEquals } from "https://deno.land/std@v0.27.0/testing/asserts.ts"; -export { serve } from "https://deno.land/std@v0.27.0/http/server.ts"; -export { runIfMain, test } from "https://deno.land/std@v0.27.0/testing/mod.ts"; +export { assertEquals } from "https://deno.land/std@v0.28.1/testing/asserts.ts"; +export { + serve, + ServerRequestBody +} from "https://deno.land/std@v0.28.1/http/server.ts"; +export { runIfMain, test } from "https://deno.land/std@v0.28.1/testing/mod.ts"; diff --git a/tests/server.ts b/tests/server.ts index 000053f6..3579631f 100644 --- a/tests/server.ts +++ b/tests/server.ts @@ -1,4 +1,4 @@ -import { serve } from "./deps.ts"; +import { serve, ServerRequestBody } from "./deps.ts"; const encode = new TextEncoder().encode; const dec = new TextDecoder(); @@ -24,13 +24,6 @@ function bootstrap(testJson) { }); } -// is this in cli/std? r: ReadCloser -async function read(r) { - const buf = new Uint8Array(10000); - const n = await r.read(buf); - return dec.decode(buf.slice(n)); -} - const statusOK = encode('{"status":"OK"}\n'); export async function serveEvents(testJson) { @@ -45,15 +38,15 @@ export async function serveEvents(testJson) { for await (const req of s) { if (req.method == "POST") { if (req.url.endsWith("/response")) { - const body = dec.decode(await req.body()); + const body = dec.decode(await Deno.readAll(req.body)); responses.push(JSON.stringify({ status: "ok", content: body })); } else if (req.url.endsWith("/init/error")) { - const body = dec.decode(await req.body()); + const body = dec.decode(await Deno.readAll(req.body)); responses.push(JSON.stringify({ status: "error", content: body })); await req.respond({ body: statusOK }); break; } else if (req.url.endsWith(`/${reqId}/error`)) { - const body = dec.decode(await req.body()); + const body = dec.decode(await Deno.readAll(req.body)); responses.push(JSON.stringify({ status: "error", content: body })); } else { throw new Error("Unreachable!"); @@ -76,7 +69,7 @@ export async function serveEvents(testJson) { } } } - /// const out = await read(p.stdout); + /// const out = await Deno.readAll(p.stdout); p.kill(9); s.close(); await p.status(); diff --git a/tests/test_bundle.json b/tests/test_bundle.json index 7e1b2430..0c69bca0 100644 --- a/tests/test_bundle.json +++ b/tests/test_bundle.json @@ -7,11 +7,11 @@ "expected": [ { "status": "ok", - "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.27.0 🦕\"}" + "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.28.1 🦕\"}" }, { "status": "ok", - "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.27.0 🦕\"}" + "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.28.1 🦕\"}" } ], "files": ["hello.bundle.js"], diff --git a/tests/test_example_zip.json b/tests/test_example_zip.json index c6c55b6e..168d1ad7 100644 --- a/tests/test_example_zip.json +++ b/tests/test_example_zip.json @@ -4,11 +4,11 @@ "expected": [ { "status": "ok", - "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.27.0 🦕\"}" + "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.28.1 🦕\"}" }, { "status": "ok", - "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.27.0 🦕\"}" + "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.28.1 🦕\"}" } ], "files": "deno-lambda-example.zip", diff --git a/tests/test_js.json b/tests/test_js.json index c9c5804f..633f356c 100644 --- a/tests/test_js.json +++ b/tests/test_js.json @@ -4,11 +4,11 @@ "expected": [ { "status": "ok", - "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.27.0 🦕\"}" + "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.28.1 🦕\"}" }, { "status": "ok", - "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.27.0 🦕\"}" + "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.28.1 🦕\"}" } ], "files": ["hello.js"], diff --git a/tests/test_self_contained.json b/tests/test_self_contained.json index e4f48b8c..7a2e2b5e 100644 --- a/tests/test_self_contained.json +++ b/tests/test_self_contained.json @@ -4,11 +4,11 @@ "expected": [ { "status": "ok", - "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.27.0 🦕\"}" + "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.28.1 🦕\"}" }, { "status": "ok", - "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.27.0 🦕\"}" + "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.28.1 🦕\"}" } ], "files": ["hello.ts", "bootstrap", "amz-deno"] diff --git a/tests/test_simple.json b/tests/test_simple.json index f12c437a..983c18b5 100644 --- a/tests/test_simple.json +++ b/tests/test_simple.json @@ -4,11 +4,11 @@ "expected": [ { "status": "ok", - "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.27.0 🦕\"}" + "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.28.1 🦕\"}" }, { "status": "ok", - "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.27.0 🦕\"}" + "content": "{\"statusCode\":200,\"body\":\"Welcome to deno 0.28.1 🦕\"}" } ], "files": ["hello.ts"],