Skip to content

Commit 899ebdc

Browse files
author
randommodder
committed
Fixed tests and removed unnecessary dependency
1 parent 94c487a commit 899ebdc

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

lib/src/api_options.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'package:nyxx/src/builders/presence.dart';
22
import 'package:nyxx/src/intents.dart';
33
import 'package:nyxx/src/utils/flags.dart';
44
import 'package:oauth2/oauth2.dart';
5-
import 'package:universal_platform/universal_platform.dart';
65

76
/// Options for connecting to the Discord API.
87
abstract class ApiOptions {
@@ -18,7 +17,7 @@ abstract class ApiOptions {
1817
/// The host at which the API can be found.
1918
///
2019
/// This is always `discord.com`.
21-
String get host => UniversalPlatform.isWeb ? 'cors2.discordworker-cfb.workers.dev' : "discord.com";//'discord.com'; cors.discordworker-cfb.workers.dev
20+
String get host => const bool.fromEnvironment('dart.library.js_util') ? 'cors2.discordworker-cfb.workers.dev' : "discord.com";//'discord.com'; cors.discordworker-cfb.workers.dev
2221

2322
/// The base URI relative to the [host] where the API can be found.
2423
String get baseUri => '/api/v$apiVersion';

pubspec.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ dependencies:
1717
runtime_type: ^1.1.0
1818
meta: ^1.16.0
1919
oauth2: ^2.0.3
20-
universal_platform: ^1.1.0
2120

2221
dev_dependencies:
2322
test: ^1.25.14

test/unit/cache/cache_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void main() {
7575
});
7676

7777
test("doesn't cache items if a filter is provided", () {
78-
final cache = MockNyxx().cache.getCache<MockSnowflakeEntity>('test', CacheConfig(shouldCache: (e) => e.id.value > BigInt.from(3))));
78+
final cache = MockNyxx().cache.getCache<MockSnowflakeEntity>('test', CacheConfig(shouldCache: (e) => e.id.value > BigInt.from(3)));
7979

8080
final entity1 = MockSnowflakeEntity(id: Snowflake(1));
8181
final entity2 = MockSnowflakeEntity(id: Snowflake(2));

test/unit/http/managers/interaction_manager_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void checkInteractionCallbackResponse(InteractionCallbackResponse interactionCal
207207

208208
void checkInteractionCallback(InteractionCallback interactionCallback) {
209209
expect(interactionCallback.activityInstanceId, equals('SomeRandomId'));
210-
expect(interactionCallback.id, equals(const Snowflake(123456789123456789)));
210+
expect(interactionCallback.id, equals(Snowflake(123456789123456789)));
211211
expect(interactionCallback.responseMessageEphemeral, equals(true));
212212
expect(interactionCallback.responseMessageLoading, equals(true));
213213
}

0 commit comments

Comments
 (0)