Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/config.example.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
String version = 'v4';

/// The instance to connect to. By default, it will use the docker container port.
String instance = 'localhost:1236';
String instance = 'proxy:1236';

/// The scheme to use. By default, it will use HTTP.
String scheme = 'http';
Expand Down
33 changes: 33 additions & 0 deletions test/v4_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import 'package:http/http.dart';
import 'package:test/test.dart';

import 'package:lemmy_dart_client/src/client/client.dart';

// Import the auth token from the config file
import 'config.dart';

void main() {
late LemmyClient client;

setUpAll(() async {
client = await LemmyClient.initialize(
instance: instance,
version: version,
scheme: scheme,
);
});

group('Client', () {
test('should fetch the proper information when initialized', () async {
expect(client.site.info, isNotNull);
expect(client.account.info, isNull);
});

test('should fail when an invalid instance is given', () async {
expect(
() async => await LemmyClient.initialize(instance: 'invalid'),
throwsA(isA<ClientException>()),
);
});
});
}