Jonatas

fix platform web tests

  1 +@TestOn('vm')
1 import 'dart:io'; 2 import 'dart:io';
2 -  
3 import 'package:flutter_test/flutter_test.dart'; 3 import 'package:flutter_test/flutter_test.dart';
4 -import 'package:get/get.dart';  
5 -import 'package:get/src/utils/platform/platform_web.dart'; 4 +import 'package:get/src/utils/platform/platform.dart';
6 5
7 void main() { 6 void main() {
8 test('Platform test', () { 7 test('Platform test', () {
@@ -13,12 +12,5 @@ void main() { @@ -13,12 +12,5 @@ void main() {
13 expect(GetPlatform.isMacOS, Platform.isMacOS); 12 expect(GetPlatform.isMacOS, Platform.isMacOS);
14 expect(GetPlatform.isWindows, Platform.isWindows); 13 expect(GetPlatform.isWindows, Platform.isWindows);
15 expect(GetPlatform.isWeb, false); 14 expect(GetPlatform.isWeb, false);
16 - expect(GeneralPlatform.isWeb, true);  
17 - expect(GeneralPlatform.isAndroid, false);  
18 - expect(GeneralPlatform.isIOS, false);  
19 - expect(GeneralPlatform.isFuchsia, false);  
20 - expect(GeneralPlatform.isLinux, false);  
21 - expect(GeneralPlatform.isMacOS, false);  
22 - expect(GeneralPlatform.isWindows, false);  
23 }); 15 });
24 } 16 }
  1 +@TestOn('browser')
  2 +import 'dart:io';
  3 +import 'package:flutter_test/flutter_test.dart';
  4 +import 'package:get/src/utils/platform/platform.dart';
  5 +
  6 +void main() {
  7 + test('Platform test', () {
  8 + expect(GetPlatform.isAndroid, Platform.isAndroid);
  9 + expect(GetPlatform.isIOS, Platform.isIOS);
  10 + expect(GetPlatform.isFuchsia, Platform.isFuchsia);
  11 + expect(GetPlatform.isLinux, Platform.isLinux);
  12 + expect(GetPlatform.isMacOS, Platform.isMacOS);
  13 + expect(GetPlatform.isWindows, Platform.isWindows);
  14 + expect(GetPlatform.isWeb, true);
  15 + });
  16 +}