From 13549dbee8de9cd28b4d51082c73a85d1c87e0c9 Mon Sep 17 00:00:00 2001 From: Seth Holladay Date: Sun, 16 Feb 2020 01:46:27 -0500 Subject: [PATCH] Update to Demo 0.33.0 --- .travis.yml | 2 +- dependencies.js | 6 +++--- dev-dependencies.js | 10 +++------- example/simple-server/dev-dependencies.js | 7 ++----- example/simple-server/test.js | 6 ++++-- test.js | 3 +-- test/bang.js | 5 +++-- test/request.js | 4 +++- test/response.js | 4 +++- test/router.js | 4 +++- test/server.jsx | 4 +++- test/toolkit.js | 4 +++- 12 files changed, 32 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 68a728c..b4707d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: python install: - - curl -fsSL https://deno.land/x/install/install.sh | sh -s v0.30.0 + - curl -fsSL https://deno.land/x/install/install.sh | sh -s v0.33.0 - export PATH="$HOME/.deno/bin:$PATH" script: diff --git a/dependencies.js b/dependencies.js index bf127b6..4fd919d 100644 --- a/dependencies.js +++ b/dependencies.js @@ -1,6 +1,6 @@ -import * as cookie from 'https://deno.land/std@v0.30.0/http/cookie.ts'; -import * as http from 'https://deno.land/std@v0.30.0/http/server.ts'; -import { Status as status, STATUS_TEXT as statusText } from 'https://deno.land/std@v0.30.0/http/http_status.ts'; +import * as cookie from 'https://deno.land/std@v0.33.0/http/cookie.ts'; +import * as http from 'https://deno.land/std@v0.33.0/http/server.ts'; +import { Status as status, STATUS_TEXT as statusText } from 'https://deno.land/std@v0.33.0/http/http_status.ts'; import React from 'https://dev.jspm.io/react@16.12.0'; import ReactDOMServer from 'https://dev.jspm.io/react-dom@16.12.0/server'; diff --git a/dev-dependencies.js b/dev-dependencies.js index fc652c3..3b94a3e 100644 --- a/dev-dependencies.js +++ b/dev-dependencies.js @@ -1,15 +1,11 @@ import { assert, assertEquals, - assertStrictEq, - runTests, - test -} from 'https://deno.land/std@v0.30.0/testing/mod.ts'; + assertStrictEq +} from 'https://deno.land/std@v0.33.0/testing/asserts.ts'; export { assert, assertEquals, - assertStrictEq, - runTests, - test + assertStrictEq }; diff --git a/example/simple-server/dev-dependencies.js b/example/simple-server/dev-dependencies.js index 66df580..b8c9d3b 100644 --- a/example/simple-server/dev-dependencies.js +++ b/example/simple-server/dev-dependencies.js @@ -1,9 +1,6 @@ -import { assertEquals, assertStrictEq } from 'https://deno.land/std@v0.30.0/testing/asserts.ts'; -import { runTests, test } from 'https://deno.land/std@v0.30.0/testing/mod.ts'; +import { assertEquals, assertStrictEq } from 'https://deno.land/std@v0.33.0/testing/asserts.ts'; export { assertEquals, - assertStrictEq, - runTests, - test + assertStrictEq }; diff --git a/example/simple-server/test.js b/example/simple-server/test.js index 4c64d34..8f1ea8d 100644 --- a/example/simple-server/test.js +++ b/example/simple-server/test.js @@ -1,6 +1,8 @@ -import { assertStrictEq, runTests, test } from './dev-dependencies.js'; +import { assertStrictEq } from './dev-dependencies.js'; import server from './main.js'; +const { runTests, test } = Deno; + test('GET /', async () => { const response = await server.inject({ method : 'GET', @@ -11,4 +13,4 @@ test('GET /', async () => { assertStrictEq(response.body, 'hi'); }); -runTests(); +await runTests(); diff --git a/test.js b/test.js index 966942b..5456a55 100644 --- a/test.js +++ b/test.js @@ -4,6 +4,5 @@ import './test/response.js'; import './test/router.js'; import './test/server.jsx'; import './test/toolkit.js'; -import { runTests } from './dev-dependencies.js'; -runTests(); +await Deno.runTests(); diff --git a/test/bang.js b/test/bang.js index 252f488..d0b3903 100644 --- a/test/bang.js +++ b/test/bang.js @@ -1,12 +1,13 @@ import { assert, assertEquals, - assertStrictEq, - test + assertStrictEq } from '../dev-dependencies.js'; import Response from '../lib/response.js'; import * as bang from '../lib/bang.js'; +const { test } = Deno; + test('new Bang() is a 500 error by default', () => { const error = new bang.Bang(); assert(error instanceof Error); diff --git a/test/request.js b/test/request.js index 503f824..f3dcd4b 100644 --- a/test/request.js +++ b/test/request.js @@ -1,8 +1,10 @@ -import { assertStrictEq, test } from '../dev-dependencies.js'; +import { assertStrictEq } from '../dev-dependencies.js'; import Response from '../lib/response.js'; import Server from '../lib/server.js'; import pogo from '../main.js'; +const { test } = Deno; + test('request.headers is a Headers instance', async () => { const server = pogo.server(); server.route({ diff --git a/test/response.js b/test/response.js index caa574a..9a64798 100644 --- a/test/response.js +++ b/test/response.js @@ -1,6 +1,8 @@ -import { assertStrictEq, test } from '../dev-dependencies.js'; +import { assertStrictEq } from '../dev-dependencies.js'; import pogo from '../main.js'; +const { test } = Deno; + test('response.code() set status code', async () => { const server = pogo.server(); server.route({ diff --git a/test/router.js b/test/router.js index 57b6256..2ce38d7 100644 --- a/test/router.js +++ b/test/router.js @@ -1,6 +1,8 @@ -import { assertEquals, test } from '../dev-dependencies.js'; +import { assertEquals } from '../dev-dependencies.js'; import Router from '../lib/router.js'; +const { test } = Deno; + test('new Router() static route', () => { const router = new Router({ method : 'GET', diff --git a/test/server.jsx b/test/server.jsx index 31e59a6..0faa413 100644 --- a/test/server.jsx +++ b/test/server.jsx @@ -1,8 +1,10 @@ import { React } from '../dependencies.js'; -import { assertEquals, assertStrictEq, test } from '../dev-dependencies.js'; +import { assertEquals, assertStrictEq } from '../dev-dependencies.js'; import * as bang from '../lib/bang.js'; import pogo from '../main.js'; +const { test } = Deno; + test('server.route() HTML response for string', async () => { const server = pogo.server(); let called = false; diff --git a/test/toolkit.js b/test/toolkit.js index 2877cbe..fbccacd 100644 --- a/test/toolkit.js +++ b/test/toolkit.js @@ -1,6 +1,8 @@ -import { assertStrictEq, test } from '../dev-dependencies.js'; +import { assertStrictEq } from '../dev-dependencies.js'; import pogo from '../main.js'; +const { test } = Deno; + test('h.response() set JSON body', async () => { const server = pogo.server(); server.route({