Bump to 2.0.0-alpha

This commit is contained in:
Tobe O 2018-08-28 10:24:44 -04:00
parent 239269acd3
commit 27f1d90c69
6 changed files with 27 additions and 22 deletions

View file

@ -0,0 +1 @@
2.0.0

Binary file not shown.

View file

@ -1,3 +1,6 @@
# 2.0.0-alpha
* Depend on Dart 2 and Angel 2.
# 1.1.0+1 # 1.1.0+1
* Dart 2/strong mode fixes. * Dart 2/strong mode fixes.
* Pass a `useZone` flag to `AngelHttp` through `TestServer`. * Pass a `useZone` flag to `AngelHttp` through `TestServer`.

View file

@ -11,30 +11,31 @@ main() {
setUp(() async { setUp(() async {
app = new Angel() app = new Angel()
..get('/hello', 'Hello') ..get('/hello', (req, res) => 'Hello')
..get( ..get(
'/error', '/error',
() => throw new AngelHttpException.forbidden(message: 'Test') (req, res) => throw new AngelHttpException.forbidden(message: 'Test')
..errors.addAll(['foo', 'bar'])) ..errors.addAll(['foo', 'bar']))
..get('/body', (ResponseContext res) { ..get('/body', (req, res) {
res res
..write('OK') ..write('OK')
..end(); ..close();
}) })
..get( ..get(
'/valid', '/valid',
() => { (req, res) => {
'michael': 'jackson', 'michael': 'jackson',
'billie': {'jean': 'hee-hee', 'is_my_lover': false} 'billie': {'jean': 'hee-hee', 'is_my_lover': false}
}) })
..post('/hello', (req, res) async { ..post('/hello', (req, res) async {
return {'bar': req.body['foo']}; var body = await req.parseBody();
return {'bar': body['foo']};
}) })
..get('/gzip', (req, res) async { ..get('/gzip', (req, res) async {
res res
..headers['content-encoding'] = 'gzip' ..headers['content-encoding'] = 'gzip'
..write(gzip.encode('Poop'.codeUnits)) ..write(gzip.encode('Poop'.codeUnits))
..end(); ..close();
}) })
..use( ..use(
'/foo', '/foo',

View file

@ -2,18 +2,17 @@ author: Tobe O <thosakwe@gmail.com>
description: Testing utility library for the Angel framework. description: Testing utility library for the Angel framework.
homepage: https://github.com/angel-dart/test.git homepage: https://github.com/angel-dart/test.git
name: angel_test name: angel_test
version: 1.1.0+1 version: 2.0.0-alpha
dependencies: dependencies:
angel_client: ^1.1.0-alpha angel_client: ^2.0.0-alpha
angel_framework: ^1.1.0-alpha angel_framework: ^2.0.0-alpha
angel_validate: ^1.0.0 angel_validate: ^2.0.0-alpha
angel_websocket: ^1.1.0-alpha angel_websocket: ^2.0.0-alpha
dart2_constant: ^1.0.0
http: ^0.11.0 http: ^0.11.0
matcher: ^0.12.0+2 matcher: ^0.12.0+2
mock_request: ^1.0.0 mock_request: ^1.0.0
web_socket_channel: ^1.0.0 web_socket_channel: ^1.0.0
dev_dependencies: dev_dependencies:
test: ^0.12.17+2 test: ^1.0.0
environment: environment:
sdk: ">=1.8.9 <3.0.0" sdk: ">=2.0.0-dev <3.0.0"

View file

@ -12,30 +12,31 @@ main() {
setUp(() async { setUp(() async {
app = new Angel() app = new Angel()
..get('/hello', 'Hello') ..get('/hello', (req, res) => 'Hello')
..get( ..get(
'/error', '/error',
() => throw new AngelHttpException.forbidden(message: 'Test') (req, res) => throw new AngelHttpException.forbidden(message: 'Test')
..errors.addAll(['foo', 'bar'])) ..errors.addAll(['foo', 'bar']))
..get('/body', (ResponseContext res) { ..get('/body', (req, res) {
res res
..write('OK') ..write('OK')
..end(); ..close();
}) })
..get( ..get(
'/valid', '/valid',
() => { (req, res) => {
'michael': 'jackson', 'michael': 'jackson',
'billie': {'jean': 'hee-hee', 'is_my_lover': false} 'billie': {'jean': 'hee-hee', 'is_my_lover': false}
}) })
..post('/hello', (req, res) async { ..post('/hello', (req, res) async {
return {'bar': req.body['foo']}; var body = await req.parseBody();
return {'bar': body['foo']};
}) })
..get('/gzip', (req, res) async { ..get('/gzip', (req, res) async {
res res
..headers['content-encoding'] = 'gzip' ..headers['content-encoding'] = 'gzip'
..write(gzip.encode('Poop'.codeUnits)) ..write(gzip.encode('Poop'.codeUnits))
..end(); ..close();
}) })
..use( ..use(
'/foo', '/foo',