Skip to content

Commit

Permalink
chore: bump package version to 0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
louisdachet committed May 13, 2024
1 parent 3f6d1ef commit 49dfe22
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.5.1

* feat: add support for skipping tests instead of failing them based on the enforced target platform defined in the `AdaptiveTestConfiguration` class.

## 0.5.0

**Breaking changes**
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,20 @@ Future<void> testExecutable(FutureOr<void> Function() testMain) async {

As an alternative you can use [Alchemist](https://pub.dev/packages/alchemist).

Also, you can configure `AdaptiveTestConfiguration` singleton to skip tests instead of throwing if they are run on an unintended platform.
```dart
Future<void> testExecutable(FutureOr<void> Function() testMain) async {
TestWidgetsFlutterBinding.ensureInitialized();
AdaptiveTestConfiguration.instance
..setSkippedTestPlatform(TargetPlatform.macOS)
..setFailTestOnWrontPlatform(false)
..setDeviceVariants(defaultDeviceConfigs);
await loadFonts();
setupFileComparatorWithThreshold();
await testMain();
}
```

### Write a test
Use `testAdaptiveWidgets` function. It take a callback with two arguments, `WidgetTester` and `WindowConfigData`.

Expand Down
6 changes: 3 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: adaptive_test
description: >-
A Flutter package to generate adaptive golden files during widget tests.
version: 0.5.0
version: 0.5.1
homepage: https://github.com/bamlab/adaptive_test
repository: https://github.com/bamlab/adaptive_test

environment:
sdk: '>=3.0.5 <4.0.0'
sdk: ">=3.0.5 <4.0.0"
flutter: ">=1.17.0"

dependencies:
Expand All @@ -29,4 +29,4 @@ flutter:
uses-material-design: true
assets:
# Add assets from the images directory to the application.
- assets/keyboards/
- assets/keyboards/

0 comments on commit 49dfe22

Please sign in to comment.