Skip to content

Commit 6a5c1b6

Browse files
committed
test(client): remove mirror
dart test, either in flutter or web browser, does not support mirror, see dart-lang/sdk#30538 and flutter/flutter#1150. Using `Directory.current.path` might still be problematic for web browser later on, but now let's focus on flutter only.
1 parent ac3c665 commit 6a5c1b6

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

packages/graphql/test/helpers.dart

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// This
2-
import 'dart:mirrors';
31
import 'dart:convert';
42
import 'dart:io' show File, Directory;
53

@@ -23,18 +21,4 @@ http.StreamedResponse simpleResponse({@required String body, int status}) {
2321

2422
return r;
2523
}
26-
27-
class _TestUtils {
28-
static String _path;
29-
30-
static String get path {
31-
if (_path == null) {
32-
final String basePath =
33-
dirname((reflectClass(_TestUtils).owner as LibraryMirror).uri.path);
34-
_path = basePath.endsWith('test') ? basePath : join(basePath, 'test');
35-
}
36-
return _path;
37-
}
38-
}
39-
40-
File tempFile(String fileName) => File(join(_TestUtils.path, fileName));
24+
File tempFile(String fileName) => File(join(Directory.current.path, fileName));

0 commit comments

Comments
 (0)