Open jumperchen opened 5 years ago
I wonder if package:test supports deferred loading at all?
Note that for web tests you should get much better test iteration times if you use build_runner
, which does support deferred loading (although I haven't tested running tests with deferred loading... but it should work).
To try that you would add a dev dependency on build_runner
, build_web_compilers
, and build_test
. Then you can run pub run build_runner test [build-args-here] -- [test-args-here]
. If you want to run your test with dart2js you would pass the -r
build argument, otherwise it will use dartdevc (which will compile incrementally much faster).
Also I confirmed package:test does not support deferred loading, https://github.com/dart-lang/test/blob/48a0d09e1b77e5e80e6b18eca6cf32626c6b59b9/pkgs/test/lib/src/runner/browser/platform.dart#L363 It does not add handlers for any extra js files.
@jakemac53 Thanks for your suggestion, we will use build_runner test
instead. Because of the issue - https://github.com/dart-lang/sdk/issues/35533, we cannot run with DDC mode, only run with Dart2JS mode. :(
Ok, we can leave this open as we should support deferred loading in package:test as well - I think it just hasn't come up as an issue in the past.
Note that the issue you filed above should actually be filed on the https://github.com/dart-lang/build/ repo, which sets up the bootstrapping (not ddc itself - a bit confusing I know). That shouldn't be to difficult to resolve.
Dart version: 2.1.0
Running with the following example causes DeferredLoadException.
For example, dart_test.dart
app_messages_all.dart - refers to - https://github.com/dart-lang/intl_translation/blob/master/test/two_components/app_messages_all.dart
app_messages_fr.dart refers to - https://github.com/dart-lang/intl_translation/blob/master/test/two_components/app_messages_fr.dart
Run with
pub run test -p chrome test/dart_test.dart
The error stacktrace: