From 32db2c2b46d57f1d422b5e7fe63645bdf900bc19 Mon Sep 17 00:00:00 2001 From: thomashii Date: Wed, 23 Jun 2021 21:06:57 +0800 Subject: [PATCH] Updated mock_request test cases --- packages/mock_request/pubspec.yaml | 3 ++- packages/mock_request/test/all_test.dart | 18 +++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/packages/mock_request/pubspec.yaml b/packages/mock_request/pubspec.yaml index 5f4a67f0..b6055160 100644 --- a/packages/mock_request/pubspec.yaml +++ b/packages/mock_request/pubspec.yaml @@ -7,6 +7,7 @@ environment: dependencies: charcode: ^1.2.0 dev_dependencies: - #angel_framework: ^2.1.0 + angel3_framework: ^4.0.0 http: ^0.13.2 test: ^1.17.4 + pedantic: ^1.11.0 diff --git a/packages/mock_request/test/all_test.dart b/packages/mock_request/test/all_test.dart index 8fb38210..24e4d5ad 100644 --- a/packages/mock_request/test/all_test.dart +++ b/packages/mock_request/test/all_test.dart @@ -1,27 +1,24 @@ -//import 'dart:convert'; -//import 'dart:io'; -//import 'package:angel_framework/angel_framework.dart'; -//import 'package:angel_framework/http.dart'; -//import 'package:mock_request/mock_request.dart'; -//import 'package:test/test.dart'; +import 'dart:convert'; +import 'dart:io'; +import 'package:angel3_framework/angel3_framework.dart'; +import 'package:angel3_framework/http.dart'; +import 'package:angel3_mock_request/angel3_mock_request.dart'; +import 'package:test/test.dart'; void main() { - /* var uri = Uri.parse('http://localhost:3000'); - var app = Angel() ..get('/foo', (req, res) => 'Hello, world!') ..post('/body', (req, res) => req.parseBody().then((_) => req.bodyAsMap.length)) ..get('/session', (req, res) async { - req.session['foo'] = 'bar'; + req.session?['foo'] = 'bar'; }) ..get('/conn', (RequestContext req, res) { return res.serialize(req.ip == InternetAddress.loopbackIPv4.address); }); - var http = AngelHttp(app); test('receive a response', () async { @@ -67,5 +64,4 @@ void main() { expect(rq.uri.path, '/mock'); expect(rq.requestedUri.toString(), 'http://example.com/mock'); }); -*/ }