Skip to content

Commit 8c11420

Browse files
committed
fix: dart
1 parent 91caee6 commit 8c11420

File tree

5 files changed

+50
-0
lines changed

5 files changed

+50
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
targets:
2+
$default:
3+
builders:
4+
json_serializable:
5+
options:
6+
any_map: false
7+
checked: true
8+
create_factory: true
9+
create_to_json: true
10+
disallow_unrecognized_keys: false
11+
explicit_to_json: true
12+
field_rename: none
13+
ignore_unannotated: false
14+
include_if_null: false
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import 'package:algolia_client_abtesting_v3/algolia_client_abtesting_v3.dart';
2+
3+
void main() async {
4+
// Creating an instance of the Abtesting V3 client with the provided App ID and API key.
5+
final abtesting = AbtestingV3Client(
6+
appId: 'latency',
7+
apiKey: '6be0576ff61c053d5f9a3225e2a90f76',
8+
region: 'us',
9+
);
10+
11+
await abtesting.getABTest(
12+
id: 123,
13+
);
14+
15+
// Close the client and dispose of all underlying resources.
16+
abtesting.dispose();
17+
}

clients/algoliasearch-client-dart/packages/client_abtesting_v3/lib/src/extension.dart

Whitespace-only changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import 'dart:io';
2+
3+
import 'package:algolia_client_abtesting_v3/src/version.dart';
4+
import 'package:test/test.dart';
5+
6+
void main() {
7+
if (Directory.current.path.endsWith('/test')) {
8+
Directory.current = Directory.current.parent;
9+
}
10+
test('package version matches pubspec', () {
11+
final pubspecPath = '${Directory.current.path}/pubspec.yaml';
12+
final pubspec = File(pubspecPath).readAsStringSync();
13+
final regex = RegExp('version:s*(.*)');
14+
final match = regex.firstMatch(pubspec);
15+
expect(match, isNotNull);
16+
expect(packageVersion, match?.group(1)?.trim());
17+
});
18+
}

tests/output/dart/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ dependencies:
1717
algolia_client_core: any
1818
dev_dependencies:
1919
lints: ^6.0.0
20+
algolia_client_abtesting_v3: any

0 commit comments

Comments
 (0)