Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/seo-4d696b75/dart-async-test-sample
Dart (Flutter) async test sample
https://github.com/seo-4d696b75/dart-async-test-sample
Last synced: about 1 month ago
JSON representation
Dart (Flutter) async test sample
- Host: GitHub
- URL: https://github.com/seo-4d696b75/dart-async-test-sample
- Owner: Seo-4d696b75
- License: mit
- Created: 2022-12-08T08:52:37.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-29T04:46:29.000Z (about 1 year ago)
- Last Synced: 2023-11-29T05:30:30.054Z (about 1 year ago)
- Language: Dart
- Size: 94.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# async_test_sample
**Feature**
- Unit test with async functions
- Uses [Mockito](https://pub.dev/packages/mockito) for mocking dependencies
- Immutable state by [freezed](https://pub.dev/packages/freezed)
- Tests StateNotifier of [riverpod](https://riverpod.dev/)For testing AsyncNotifier of Riverpod 2.0, [please see this branch.](https://github.com/Seo-4d696b75/dart-async-test-sample/tree/riverpod2)
非同期処理のテストサンプルです([解説記事](https://qiita.com/Seo-4d696b75/private/b677999b4a82fcda11dd))。
Riverpod 2.0以降のAsyncNotifierのテストは[こちらのブランチにあります。](https://github.com/Seo-4d696b75/dart-async-test-sample/tree/riverpod2)## App to be Tested
1. Put keyword string
2. Tap "Search" button or "Next" button on the soft keyboard
3. Progress indicator shown while searching
4. Search results (string list) shown## Setup
### 0. Install Flutter (if needed)
This project uses fvm.
After installing, be sure to set "${projectRoot}/.fvm/flutter_sdk" as Flutter SDK path in your IDE.`fvm install`
### 1. Install dependencies
`fvm flutter pub get`
### 2. Run Build Runner
`fvm flutter pub run build_runner build`
## Run Tests
`fvm flutter test`
Some tests fail, while others get passed.
[Please see test codes for more details.](./test/view_model/search_view_model_test.dart)