Skip to content

Commit ae8285d

Browse files
committed
build: bump up dependencies
Closes #74
1 parent 5370231 commit ae8285d

File tree

6 files changed

+34
-6
lines changed

6 files changed

+34
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- Unit testing tips to the README file —
1313
[73](https://github.com/dartoos-dev/json_cache/issues/73).
1414

15+
### Changed
16+
17+
- Bump up dependencies —
18+
[74](https://github.com/dartoos-dev/json_cache/issues/74).
19+
1520
## [1.2.1] - 2022-04-02
1621

1722
### Changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Rultor.com](https://www.rultor.com/b/dartoos-dev/json_cache)](https://www.rultor
3636
- [Using Fake Implementation](#using-fake-implementation)
3737
- [Widget Testing](#widget-testing)
3838
- [Example of Widget Test Code](#example-of-widget-test-code)
39+
- [SharedPreferences in Tests](#sharedpreferences-in-tests)
3940
- [Demo application](#demo-application)
4041
- [Contribute](#contribute)
4142
- [References](#references)
@@ -337,6 +338,25 @@ testWidgets('refresh cached value', (WidgetTester tester) async {
337338
});
338339
```
339340

341+
### SharedPreferences in Tests
342+
343+
Whenever you run any unit tests involving the
344+
[shared_preferences](https://pub.dev/packages/shared_preferences) package, you
345+
must call the `SharedPreferences.setMockInitialValues()` function at the very
346+
beginning of the test file; otherwise, the system may throw an error whose
347+
description is: 'Binding has not yet been initialized'.
348+
349+
Example:
350+
351+
```dart
352+
353+
void main() {
354+
SharedPreferences.setMockInitialValues({});
355+
// the test cases come below
356+
357+
}
358+
```
359+
340360
## Demo application
341361

342362
The demo application provides a fully working example, focused on demonstrating

pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ packages:
112112
name: encrypted_shared_preferences
113113
url: "https://pub.dartlang.org"
114114
source: hosted
115-
version: "3.0.0"
115+
version: "3.0.1"
116116
fake_async:
117117
dependency: transitive
118118
description:
@@ -211,7 +211,7 @@ packages:
211211
name: hive
212212
url: "https://pub.dartlang.org"
213213
source: hosted
214-
version: "2.1.0"
214+
version: "2.2.3"
215215
http_multi_server:
216216
dependency: transitive
217217
description:
@@ -400,7 +400,7 @@ packages:
400400
name: shared_preferences
401401
url: "https://pub.dartlang.org"
402402
source: hosted
403-
version: "2.0.13"
403+
version: "2.0.15"
404404
shared_preferences_android:
405405
dependency: transitive
406406
description:

pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ environment:
1010

1111
dependencies:
1212
cross_local_storage: ^2.0.1
13-
encrypted_shared_preferences: ^3.0.0
13+
encrypted_shared_preferences: ^3.0.1
1414
flutter:
1515
sdk: flutter
1616
flutter_secure_storage: ^5.0.2
17-
hive: ^2.1.0
17+
hive: ^2.2.3
1818
localstorage: ^4.0.0+1
1919
mutex: ^3.0.0
20-
shared_preferences: ^2.0.13
20+
shared_preferences: ^2.0.15
2121

2222
dev_dependencies:
2323
flutter_test:

test/json_cache_cross_local_storage_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import 'package:cross_local_storage/cross_local_storage.dart';
22
import 'package:flutter_test/flutter_test.dart';
33
import 'package:json_cache/json_cache.dart';
4+
import 'package:shared_preferences/shared_preferences.dart';
45

56
void main() {
7+
SharedPreferences.setMockInitialValues({});
68
group('JsonCacheCrossLocalStorage', () {
79
test('clear, recover and refresh', () async {
810
final prefs = await LocalStorage.getInstance();

test/json_cache_mem_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class _JsonCacheThrowsAfterN extends JsonCacheWrap {
2222
}
2323

2424
void main() {
25+
SharedPreferences.setMockInitialValues({});
2526
group('JsonCacheMem', () {
2627
const profKey = 'profile';
2728
const profData = <String, dynamic>{'id': 1, 'name': 'John Due'};

0 commit comments

Comments
 (0)