Skip to content

Commit

Permalink
Update to Demo 0.33.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sholladay committed Feb 16, 2020
1 parent 26eeb57 commit 13549db
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
6 changes: 3 additions & 3 deletions dependencies.js
Original file line number Diff line number Diff line change
@@ -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/[email protected]';
import ReactDOMServer from 'https://dev.jspm.io/[email protected]/server';

Expand Down
10 changes: 3 additions & 7 deletions dev-dependencies.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import {
assert,
assertEquals,
assertStrictEq,
runTests,
test
} from 'https://deno.land/[email protected]/testing/mod.ts';
assertStrictEq
} from 'https://deno.land/[email protected]/testing/asserts.ts';

export {
assert,
assertEquals,
assertStrictEq,
runTests,
test
assertStrictEq
};
7 changes: 2 additions & 5 deletions example/simple-server/dev-dependencies.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { assertEquals, assertStrictEq } from 'https://deno.land/[email protected]/testing/asserts.ts';
import { runTests, test } from 'https://deno.land/[email protected]/testing/mod.ts';
import { assertEquals, assertStrictEq } from 'https://deno.land/[email protected]/testing/asserts.ts';

export {
assertEquals,
assertStrictEq,
runTests,
test
assertStrictEq
};
6 changes: 4 additions & 2 deletions example/simple-server/test.js
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -11,4 +13,4 @@ test('GET /', async () => {
assertStrictEq(response.body, 'hi');
});

runTests();
await runTests();
3 changes: 1 addition & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
5 changes: 3 additions & 2 deletions test/bang.js
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
4 changes: 3 additions & 1 deletion test/request.js
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
4 changes: 3 additions & 1 deletion test/response.js
Original file line number Diff line number Diff line change
@@ -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({
Expand Down
4 changes: 3 additions & 1 deletion test/router.js
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
4 changes: 3 additions & 1 deletion test/server.jsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
4 changes: 3 additions & 1 deletion test/toolkit.js
Original file line number Diff line number Diff line change
@@ -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({
Expand Down

0 comments on commit 13549db

Please sign in to comment.