Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Unified Diff: sdk/lib/_internal/pub/test/transformer/fails_to_load_a_transform_from_a_deps_dev_dependency_test.dart

Issue 1106803002: Properly print an error when failing to load a transformer. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/barback/dependency_computer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/test/transformer/fails_to_load_a_transform_from_a_deps_dev_dependency_test.dart
diff --git a/sdk/lib/_internal/pub/test/transformer/runs_one_third_party_transformer_on_another_test.dart b/sdk/lib/_internal/pub/test/transformer/fails_to_load_a_transform_from_a_deps_dev_dependency_test.dart
similarity index 56%
copy from sdk/lib/_internal/pub/test/transformer/runs_one_third_party_transformer_on_another_test.dart
copy to sdk/lib/_internal/pub/test/transformer/fails_to_load_a_transform_from_a_deps_dev_dependency_test.dart
index 079e3776d7ee12991371df5e360aff39e4500492..300883544fdf3052c2fe61b6d0c6772f4d46bc4d 100644
--- a/sdk/lib/_internal/pub/test/transformer/runs_one_third_party_transformer_on_another_test.dart
+++ b/sdk/lib/_internal/pub/test/transformer/fails_to_load_a_transform_from_a_deps_dev_dependency_test.dart
@@ -4,6 +4,9 @@
library pub_tests;
+import 'package:scheduled_test/scheduled_test.dart';
+
+import '../../lib/src/exit_codes.dart' as exit_codes;
import '../descriptor.dart' as d;
import '../test_pub.dart';
import '../serve/utils.dart';
@@ -11,46 +14,37 @@ import '../serve/utils.dart';
main() {
initConfig();
withBarbackVersions("any", () {
- integration("runs one third-party transformer on another", () {
- d.dir("foo", [
- d.pubspec({
- "name": "foo",
- "version": "1.0.0"
- }),
- d.dir("lib", [
- d.file("transformer.dart", dartTransformer('foo')),
- ])
- ]).create();
-
+ integration("fails to load a transform from a non-dependency", () {
d.dir("bar", [
d.pubspec({
"name": "bar",
"version": "1.0.0",
- "transformers": ["foo/transformer"],
- "dependencies": {"foo": {"path": "../foo"}}
}),
d.dir("lib", [
d.file("transformer.dart", dartTransformer('bar')),
])
]).create();
+ d.dir("foo", [
+ d.pubspec({
+ "name": "foo",
+ "version": "1.0.0",
+ "dev_dependencies": {"bar": {"path": "../bar"}},
+ "transformers": ["bar"]
+ })
+ ]).create();
+
d.dir(appPath, [
d.pubspec({
"name": "myapp",
- "transformers": ["bar/transformer"],
- "dependencies": {'bar': {'path': '../bar'}}
- }),
- d.dir("web", [
- d.file("main.dart", 'const TOKEN = "main.dart";')
- ])
+ "dependencies": {"foo": {"path": "../foo"}}
+ })
]).create();
- createLockFile('myapp', sandbox: ['foo', 'bar'], pkg: ['barback']);
-
- pubServe();
- requestShouldSucceed("main.dart",
- 'const TOKEN = "(main.dart, (bar, foo))";');
- endPubServe();
+ var pub = startPubServe();
+ pub.stderr.expect(contains('Error loading transformer "bar": package '
+ '"bar" is not a dependency.'));
+ pub.shouldExit(exit_codes.DATA);
});
});
}
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/barback/dependency_computer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698