Skip to content

Commit

Permalink
Merge pull request #21 from hayd/0.28.1
Browse files Browse the repository at this point in the history
Bump version to 0.28.1
  • Loading branch information
hayd committed Jan 5, 2020
2 parents 1b42730 + e478979 commit e9dfad0
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 35 deletions.
8 changes: 2 additions & 6 deletions example/deps.ts
Original file line number Diff line number Diff line change
@@ -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";
4 changes: 2 additions & 2 deletions example/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion example/test_util.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 6 additions & 3 deletions tests/deps.ts
Original file line number Diff line number Diff line change
@@ -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";
17 changes: 5 additions & 12 deletions tests/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { serve } from "./deps.ts";
import { serve, ServerRequestBody } from "./deps.ts";

const encode = new TextEncoder().encode;
const dec = new TextDecoder();
Expand All @@ -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) {
Expand All @@ -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!");
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions tests/test_bundle.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
4 changes: 2 additions & 2 deletions tests/test_example_zip.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions tests/test_js.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
4 changes: 2 additions & 2 deletions tests/test_self_contained.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 2 additions & 2 deletions tests/test_simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit e9dfad0

Please sign in to comment.