Skip to content

Commit c5daba6

Browse files
authored
Don't load cli_pkg/testing on Node (#959)
This transitively loads dart:mirrors, which has stopped working as of Dart 2.8.0-dev.9.0. See dart-lang/sdk#40698
1 parent 4f8f509 commit c5daba6

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@ jobs:
9191
node_js: lts/dubnium
9292
- <<: *node-tests
9393
os: osx
94-
# TODO(nweiz): Test Node tests with Dart dev when dart-lang/test#1184 is
95-
# fixed.
94+
- <<: *node-tests
95+
name: Node tests | Dart dev | Node stable
96+
env: DART_CHANNEL=dev
9697

9798
# Miscellaneous checks.
9899
- name: static analysis

test/ensure_npm_package.dart

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,10 @@
44

55
import 'dart:async';
66

7-
import 'package:cli_pkg/testing.dart' as pkg;
8-
import 'package:stream_channel/stream_channel.dart';
97
import 'package:test/test.dart';
108

119
import 'package:sass/src/io.dart';
1210

13-
void hybridMain(StreamChannel<Object> channel) async {
14-
pkg.ensureExecutableUpToDate("sass", node: true);
15-
channel.sink.close();
16-
}
17-
1811
/// Ensures that the NPM package is compiled and up-to-date.
1912
///
2013
/// This is safe to call even outside the Dart VM.
@@ -23,6 +16,14 @@ Future<void> ensureNpmPackage() async {
2316
// path handling in the SDK.
2417
if (isNode && isWindows) return;
2518

26-
var channel = spawnHybridUri("/test/ensure_npm_package.dart");
19+
var channel = spawnHybridCode("""
20+
import 'package:cli_pkg/testing.dart' as pkg;
21+
import 'package:stream_channel/stream_channel.dart';
22+
23+
void hybridMain(StreamChannel<Object> channel) async {
24+
pkg.ensureExecutableUpToDate("sass", node: true);
25+
channel.sink.close();
26+
}
27+
""");
2728
await channel.stream.toList();
2829
}

0 commit comments

Comments
 (0)