-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add client access via
ParseDioClient.client
and `ParseHTTPCli…
…ent.client` (#1025)
- Loading branch information
1 parent
a3449f4
commit af14388
Showing
7 changed files
with
68 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:dio/dio.dart'; | ||
import 'package:parse_server_sdk/parse_server_sdk.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
import '../../test_utils.dart'; | ||
|
||
void main() { | ||
setUpAll(() async { | ||
await initializeParse(); | ||
}); | ||
|
||
group('ParseDioClient Tests', () { | ||
late ParseDioClient parseDioClient; | ||
|
||
setUp(() async { | ||
parseDioClient = ParseDioClient(); | ||
}); | ||
|
||
test('should return an instance of Dio from dioClient', () { | ||
// arrange | ||
final dioClient = parseDioClient.client; | ||
|
||
// assert | ||
expect(dioClient, isNotNull); | ||
expect(dioClient, isA<Dio>()); | ||
}); | ||
}); | ||
} |
28 changes: 28 additions & 0 deletions
28
packages/dart/test/src/network/parse_http_client_test.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import 'package:http/http.dart' as http; | ||
import 'package:parse_server_sdk/parse_server_sdk.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
import '../../test_utils.dart'; | ||
|
||
void main() { | ||
setUpAll(() async { | ||
await initializeParse(); | ||
}); | ||
|
||
group('ParseDioClient Tests', () { | ||
late ParseHTTPClient parseHTTPClient; | ||
|
||
setUp(() async { | ||
parseHTTPClient = ParseHTTPClient(); | ||
}); | ||
|
||
test('should return an instance of Dio from dioClient', () { | ||
// arrange | ||
final dioClient = parseHTTPClient.client; | ||
|
||
// assert | ||
expect(dioClient, isNotNull); | ||
expect(dioClient, isA<http.BaseClient>()); | ||
}); | ||
}); | ||
} |