Merge pull request #6 from dukefirehawk/angel3

Angel3
This commit is contained in:
Thomas Hii 2021-09-26 00:11:24 +08:00 committed by GitHub
commit 8f0a8155d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 148 additions and 127 deletions

View file

@ -1,10 +1,13 @@
# angel3_merge_map # angel3_merge_map
[![version](https://img.shields.io/badge/pub-v2.0.2-brightgreen)](https://pub.dartlang.org/packages/angel3_merge_map) [![version](https://img.shields.io/badge/pub-v2.0.2-brightgreen)](https://pub.dartlang.org/packages/angel3_merge_map)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/merge_map/LICENSE) [![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/merge_map/LICENSE)
**DEPRECATED: Replaced by [`belatuk_merge_map`](https://pub.dartlang.org/packages/belatuk_merge_map) package**
Combine multiple Maps into one. Equivalent to Combine multiple Maps into one. Equivalent to
[Object.assign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) [Object.assign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
in JS. in JS.

View file

@ -1,5 +1,9 @@
# Change Log # Change Log
## 3.1.0
* Updated linter to `package:lints`
## 3.0.1 ## 3.0.1
* Fixed json data issue * Fixed json data issue

View file

@ -1,21 +1,29 @@
MIT License (MIT) BSD 3-Clause License
Copyright (c) 2021 dukefirehawk.com Copyright (c) 2021, dukefirehawk.com
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy Redistribution and use in source and binary forms, with or without
of this software and associated documentation files (the "Software"), to deal modification, are permitted provided that the following conditions are met:
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all 1. Redistributions of source code must retain the above copyright notice, this
copies or substantial portions of the Software. list of conditions and the following disclaimer.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 2. Redistributions in binary form must reproduce the above copyright notice,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, this list of conditions and the following disclaimer in the documentation
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE and/or other materials provided with the distribution.
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 3. Neither the name of the copyright holder nor the names of its
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE contributors may be used to endorse or promote products derived from
SOFTWARE. this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -1,10 +1,9 @@
# Angel3 ORM for Postgresql # Angel3 ORM for Postgresql
[![version](https://img.shields.io/badge/pub-v4.0.1-brightgreen)](https://pub.dartlang.org/packages/angel3_orm_postgres) ![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_orm_postgres?include_prereleases)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/orm/angel_orm_postgres/LICENSE)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/orm/angel_orm_postgres/LICENSE)
Postgresql support for Angel3 ORM. Supported version: 9, 10, 11 and 12. Postgresql support for Angel3 ORM. Supported version: 9, 10, 11 and 12.

View file

@ -1,4 +1 @@
include: package:pedantic/analysis_options.yaml include: package:lints/recommended.yaml
analyzer:
strong-mode:
implicit-casts: false

View file

@ -1,17 +1,17 @@
name: angel3_orm_postgres name: angel3_orm_postgres
version: 3.0.1 version: 3.1.0
description: PostgreSQL support for Angel3 ORM. Includes functionality for querying and transactions. description: PostgreSQL support for Angel3 ORM. Includes functionality for querying and transactions.
homepage: https://angel3-framework.web.app/ homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/orm/angel_orm_postgres repository: https://github.com/dukefirehawk/angel/tree/master/packages/orm/angel_orm_postgres
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'
dependencies: dependencies:
angel3_orm: ^4.0.0 angel3_orm: ^4.0.0
logging: ^1.0.1 logging: ^1.0.1
pool: ^1.5.0 pool: ^1.5.0
postgres: ^2.3.2 postgres: ^2.4.1
dev_dependencies: dev_dependencies:
angel3_pretty_logging: ^3.0.0 belatuk_pretty_logging: ^4.0.0
test: ^1.17.0
pedantic: ^1.11.0
angel3_orm_test: ^3.0.0 angel3_orm_test: ^3.0.0
test: ^1.17.5
lints: ^1.0.0

View file

@ -1,6 +1,6 @@
import 'package:angel3_orm_test/angel3_orm_test.dart'; import 'package:angel3_orm_test/angel3_orm_test.dart';
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
import 'package:angel3_pretty_logging/angel3_pretty_logging.dart'; import 'package:belatuk_pretty_logging/belatuk_pretty_logging.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';
import 'common.dart'; import 'common.dart';

View file

@ -6,6 +6,8 @@
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/pretty_logging/LICENSE) [![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/pretty_logging/LICENSE)
**DEPRECATED: Replaced by [`belatuk_pretty_logging`](https://pub.dartlang.org/packages/belatuk_pretty_logging) package**
Standalone helper for colorful logging output, using pkg:io AnsiCode. Standalone helper for colorful logging output, using pkg:io AnsiCode.
## Installation ## Installation

View file

@ -1,5 +1,9 @@
# Change Log # Change Log
## 3.1.0
* Updated linter to `package:lints`
## 3.0.1 ## 3.0.1
* Run `dartfmt -w .` to correct the formating * Run `dartfmt -w .` to correct the formating

View file

@ -1,21 +1,29 @@
MIT License BSD 3-Clause License
Copyright (c) 2021 dukefirehawk.com Copyright (c) 2021, dukefirehawk.com
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy Redistribution and use in source and binary forms, with or without
of this software and associated documentation files (the "Software"), to deal modification, are permitted provided that the following conditions are met:
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all 1. Redistributions of source code must retain the above copyright notice, this
copies or substantial portions of the Software. list of conditions and the following disclaimer.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 2. Redistributions in binary form must reproduce the above copyright notice,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, this list of conditions and the following disclaimer in the documentation
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE and/or other materials provided with the distribution.
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 3. Neither the name of the copyright holder nor the names of its
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE contributors may be used to endorse or promote products derived from
SOFTWARE. this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -1,12 +1,10 @@
# Angel3 Security # Angel3 Security
[![version](https://img.shields.io/badge/pub-v3.0.1-brightgreen)](https://pub.dartlang.org/packages/angel3_security) ![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_security?include_prereleases)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/security/LICENSE)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/security/LICENSE) Angel3 middleware designed to enhance application security by patching common Web security holes.
Angel3 middleware designed to enhance application security by patching common Web security
holes.
**This package is currently going through a major overhaul, for version 2.** **This package is currently going through a major overhaul, for version 2.**

View file

@ -1,4 +1 @@
include: package:pedantic/analysis_options.yaml include: package:lints/recommended.yaml
analyzer:
strong-mode:
implicit-casts: false

View file

@ -4,7 +4,7 @@ import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_framework/http.dart'; import 'package:angel3_framework/http.dart';
import 'package:angel3_security/angel3_security.dart'; import 'package:angel3_security/angel3_security.dart';
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
import 'package:angel3_pretty_logging/angel3_pretty_logging.dart'; import 'package:belatuk_pretty_logging/belatuk_pretty_logging.dart';
void main() async { void main() async {
// Logging boilerplate. // Logging boilerplate.

View file

@ -2,7 +2,7 @@ import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_framework/http.dart'; import 'package:angel3_framework/http.dart';
import 'package:angel3_security/angel3_security.dart'; import 'package:angel3_security/angel3_security.dart';
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
import 'package:angel3_pretty_logging/angel3_pretty_logging.dart'; import 'package:belatuk_pretty_logging/belatuk_pretty_logging.dart';
void main() async { void main() async {
// Logging boilerplate. // Logging boilerplate.

View file

@ -1,18 +1,18 @@
name: angel3_security name: angel3_security
version: 3.0.1 version: 3.1.0
description: Angel infrastructure for improving security, rate limiting, and more description: Angel3 infrastructure for improving security, rate limiting, and more
homepage: https://github.com/dukefirehawk/angel/tree/angel3/packages/security homepage: https://github.com/dukefirehawk/angel/tree/master/packages/security
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'
dependencies: dependencies:
angel3_framework: ^4.0.0 angel3_framework: ^4.2.0
crypto: ^3.0.1 crypto: ^3.0.1
dev_dependencies: dev_dependencies:
angel3_auth: ^4.0.0 angel3_auth: ^4.0.0
angel3_production: ^3.0.0 angel3_production: ^3.1.0
angel3_redis: ^2.0.0 angel3_redis: ^2.0.0
angel3_test: ^4.0.0 angel3_test: ^4.0.0
angel3_validate: ^4.0.0 angel3_validate: ^4.0.0
angel3_pretty_logging: ^3.0.0 belatuk_pretty_logging: ^4.0.0
pedantic: ^1.11.1 test: ^1.17.5
test: ^1.17.8 lints: ^1.0.0

View file

@ -1,5 +1,9 @@
# Change Log # Change Log
## 3.0.0-dev.2
* Updated to use `package:belatuk_pretty_logging`
## 3.0.0-dev.1 ## 3.0.0-dev.1
* Migrated to support Dart SDK 2.12.x NNBD * Migrated to support Dart SDK 2.12.x NNBD

View file

@ -3,7 +3,7 @@
![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_shelf?include_prereleases) ![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_shelf?include_prereleases)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
[![License](https://img.shields.io/github/license/dart-backend/belatuk-common-utilities)](https://github.com/dukefirehawk/angel/tree/angel3/packages/shelf/LICENSE) [![License](https://img.shields.io/github/license/dart-backend/belatuk-common-utilities)](https://github.com/dukefirehawk/angel/tree/master/packages/shelf/LICENSE)
**Replacement of `package:angel_shelf` with breaking changes to support NNBD.** **Replacement of `package:angel_shelf` with breaking changes to support NNBD.**

View file

@ -3,7 +3,7 @@ import 'package:angel3_container/mirrors.dart';
import 'package:angel3_framework/angel3_framework.dart'; import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_shelf/angel3_shelf.dart'; import 'package:angel3_shelf/angel3_shelf.dart';
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
import 'package:angel3_pretty_logging/angel3_pretty_logging.dart'; import 'package:belatuk_pretty_logging/belatuk_pretty_logging.dart';
import 'package:shelf/shelf.dart' as shelf; import 'package:shelf/shelf.dart' as shelf;
import 'package:shelf/shelf_io.dart' as shelf_io; import 'package:shelf/shelf_io.dart' as shelf_io;
import 'package:shelf_static/shelf_static.dart'; import 'package:shelf_static/shelf_static.dart';

View file

@ -3,7 +3,7 @@ import 'package:angel3_framework/angel3_framework.dart';
import 'package:angel3_framework/http.dart'; import 'package:angel3_framework/http.dart';
import 'package:angel3_shelf/angel3_shelf.dart'; import 'package:angel3_shelf/angel3_shelf.dart';
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
import 'package:angel3_pretty_logging/angel3_pretty_logging.dart'; import 'package:belatuk_pretty_logging/belatuk_pretty_logging.dart';
import 'package:shelf_static/shelf_static.dart'; import 'package:shelf_static/shelf_static.dart';
void main() async { void main() async {

View file

@ -1,12 +1,12 @@
name: angel3_shelf name: angel3_shelf
version: 3.0.0-dev.1 version: 3.0.0-dev.2
description: Shelf interop with Angel3. Use this to wrap existing server code. description: Shelf interop with Angel3. Use this to wrap existing server code.
homepage: https://angel3-framework.web.app/ homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/shelf repository: https://github.com/dukefirehawk/angel/tree/master/packages/shelf
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'
dependencies: dependencies:
angel3_framework: ^4.1.0 angel3_framework: ^4.2.0
angel3_container: ^3.0.0 angel3_container: ^3.0.0
angel3_mock_request: ^2.0.0 angel3_mock_request: ^2.0.0
path: ^1.8.0 path: ^1.8.0
@ -17,7 +17,7 @@ dependencies:
http: ^0.13.0 http: ^0.13.0
dev_dependencies: dev_dependencies:
angel3_test: ^4.0.0 angel3_test: ^4.0.0
angel3_pretty_logging: ^3.0.0 belatuk_pretty_logging: ^4.0.0
shelf_static: ^1.0.0 shelf_static: ^1.0.0
test: ^1.17.7 test: ^1.17.5
lints: ^1.0.0 lints: ^1.0.0

View file

@ -7,7 +7,7 @@ import 'package:angel3_test/angel3_test.dart';
import 'package:charcode/charcode.dart'; import 'package:charcode/charcode.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:logging/logging.dart'; import 'package:logging/logging.dart';
import 'package:angel3_pretty_logging/angel3_pretty_logging.dart'; import 'package:belatuk_pretty_logging/belatuk_pretty_logging.dart';
import 'package:shelf/shelf.dart' as shelf; import 'package:shelf/shelf.dart' as shelf;
import 'package:stream_channel/stream_channel.dart'; import 'package:stream_channel/stream_channel.dart';
import 'package:test/test.dart'; import 'package:test/test.dart';

View file

@ -1,5 +1,9 @@
# Change Log # Change Log
## 4.1.0
* Updated linter to `package:lints`
## 4.0.3 ## 4.0.3
* Updated README * Updated README

View file

@ -1,21 +1,29 @@
MIT License (MIT) BSD 3-Clause License
Copyright (c) 2021 dukefirehawk.com Copyright (c) 2021, dukefirehawk.com
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy Redistribution and use in source and binary forms, with or without
of this software and associated documentation files (the "Software"), to deal modification, are permitted provided that the following conditions are met:
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all 1. Redistributions of source code must retain the above copyright notice, this
copies or substantial portions of the Software. list of conditions and the following disclaimer.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 2. Redistributions in binary form must reproduce the above copyright notice,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, this list of conditions and the following disclaimer in the documentation
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE and/or other materials provided with the distribution.
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 3. Neither the name of the copyright holder nor the names of its
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE contributors may be used to endorse or promote products derived from
SOFTWARE. this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -1,24 +1,15 @@
# Angel3 Testing Library # Angel3 Testing Library
[![version](https://img.shields.io/badge/pub-v4.0.3-brightgreen)](https://pub.dartlang.org/packages/angel3_test) ![Pub Version (including pre-releases)](https://img.shields.io/pub/v/angel3_test?include_prereleases)
[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) [![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety)
[![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion) [![Gitter](https://img.shields.io/gitter/room/angel_dart/discussion)](https://gitter.im/angel_dart/discussion)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/master/packages/test/LICENSE)
[![License](https://img.shields.io/github/license/dukefirehawk/angel)](https://github.com/dukefirehawk/angel/tree/angel3/packages/test/LICENSE)
Testing utility library for the Angel3 framework. Testing utility library for the Angel3 framework.
## TestClient ## TestClient
The `TestClient` class is a custom `angel3_client` that sends mock requests to your server. The `TestClient` class is a custom `angel3_client` that sends mock requests to your server. This means that you will not have to bind your server to HTTP to run. Plus, it is an `angel3_client`, and thus supports services and other goodies. The `TestClient` also supports WebSockets. WebSockets cannot be mocked (yet!) within this library, so calling the `websocket()` function will also bind your server to HTTP, if it is not already listening. The return value is a `WebSockets` client instance (from [`package:angel3_websocket`](https://github.com/dukefirehawk/angel/tree/angel3/packages/websocket));
This means that you will not have to bind your server to HTTP to run.
Plus, it is an `angel3_client`, and thus supports services and other goodies.
The `TestClient` also supports WebSockets. WebSockets cannot be mocked (yet!) within this library,
so calling the `websocket()` function will also bind your server to HTTP, if it is not already listening.
The return value is a `WebSockets` client instance
(from [`package:angel3_websocket`](https://github.com/dukefirehawk/angel/tree/angel3/packages/websocket));
```dart ```dart
var ws = await client.websocket('/ws'); var ws = await client.websocket('/ws');
@ -30,11 +21,10 @@ ws.onData.listen(...);
## Matchers ## Matchers
Several `Matcher`s are bundled with this package, and run on any `package:http` `Response`, Several `Matcher`s are bundled with this package, and run on any `package:http` `Response`, not just those returned by Angel.
not just those returned by Angel.
```dart ```dart
test('foo', () async { void test('foo', () async {
var res = await client.get('/foo'); var res = await client.get('/foo');
expect(res, allOf([ expect(res, allOf([
isJson({'foo': 'bar'}), isJson({'foo': 'bar'}),
@ -49,18 +39,14 @@ test('foo', () async {
])); ]));
}); });
test('error', () async { void test('error', () async {
var res = await client.get('/error'); var res = await client.get('/error');
expect(res, isAngelHttpException()); expect(res, isAngelHttpException());
expect(res, isAngelHttpException(statusCode: 404, message: ..., errors: [...])) // Optional expect(res, isAngelHttpException(statusCode: 404, message: ..., errors: [...])) // Optional
}); });
``` ```
`hasValidBody` is one of the most powerful `Matcher`s in this library, because it allows you to validate a JSON body against a [validation schema](https://github.com/dukefirehawk/angel/tree/angel3/packages/validate). `hasValidBody` is one of the most powerful `Matcher`s in this library, because it allows you to validate a JSON body against a validation schema. Angel3 provides a comprehensive [validation library](<https://github.com/dukefirehawk/angel/tree/master/packages/validate>) that integrates tightly with the `matcher` package that you already use for testing.
Angel provides a comprehensive validation library that integrates tightly with the very `matcher` package that you already use for testing.
[`package:angel3_validate`](https://github.com/dukefirehawk/angel/tree/angel3/packages//validate)
```dart ```dart
test('validate response', () async { test('validate response', () async {

View file

@ -1,4 +1 @@
include: package:pedantic/analysis_options.yaml include: package:lints/recommended.yaml
analyzer:
strong-mode:
implicit-casts: false

View file

@ -106,7 +106,9 @@ class TestClient extends client.BaseAngelClient {
if (authToken?.isNotEmpty == true) { if (authToken?.isNotEmpty == true) {
rq.headers.add('authorization', 'Bearer $authToken'); rq.headers.add('authorization', 'Bearer $authToken');
} }
rq..cookies.addAll(cookies)..session.addAll(session); rq
..cookies.addAll(cookies)
..session.addAll(session);
await request.finalize().pipe(rq); await request.finalize().pipe(rq);

View file

@ -1,22 +1,22 @@
name: angel3_test name: angel3_test
version: 4.0.3 version: 4.1.0
description: Testing utility library for the Angel3 framework. Use with package:test. description: Testing utility library for the Angel3 framework. Use with package:test.
homepage: https://angel3-framework.web.app/ homepage: https://angel3-framework.web.app/
repository: https://github.com/dukefirehawk/angel/tree/angel3/packages/test repository: https://github.com/dukefirehawk/angel/tree/master/packages/test
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'
dependencies: dependencies:
angel3_client: ^4.0.0 angel3_client: ^4.1.0
angel3_framework: ^4.0.0 angel3_framework: ^4.2.0
angel3_http_exception: ^3.0.0 angel3_http_exception: ^3.0.0
angel3_validate: ^4.0.0 angel3_validate: ^4.0.0
angel3_websocket: ^4.0.0 angel3_websocket: ^4.1.0
angel3_mock_request: ^2.0.0 angel3_mock_request: ^2.0.0
angel3_container: ^3.0.0 angel3_container: ^3.0.0
http: ^0.13.1 http: ^0.13.1
matcher: ^0.12.10 matcher: ^0.12.10
web_socket_channel: ^2.0.0 web_socket_channel: ^2.0.0
dev_dependencies: dev_dependencies:
test: ^1.17.4 test: ^1.17.5
pedantic: ^1.11.0 lints: ^1.0.0