Skip to content

Commit

Permalink
Fix test that require dotenv
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorAguero committed May 8, 2024
1 parent 3ee8778 commit 5b4c238
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/core/providers/client_network_provider_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import 'package:batucadapp/constants.dart';
import 'package:batucadapp/core/providers/client_network.dart';
import 'package:dio/dio.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:http_mock_adapter/http_mock_adapter.dart';
Expand All @@ -21,6 +22,14 @@ class Listener<T> extends Mock {
}

void main() {
setUpAll(() {
dotenv.testLoad(
fileInput: '''
API_URL=https://api.example.com
''',
);
});

const dioOkResponseCode = 200;
group('ClientNetwork build', () {
test('Dio is configured with correct base URL and language', () async {
Expand Down

0 comments on commit 5b4c238

Please sign in to comment.