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

Unified Diff: packages/code_transformers/test/entry_point_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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
Index: packages/code_transformers/test/entry_point_test.dart
diff --git a/packages/code_transformers/test/entry_point_test.dart b/packages/code_transformers/test/entry_point_test.dart
index 99c43694399dbe122204bd4f97985ecccb672515..31f84c7b57b6f866960385cd61a2b2c990c582f0 100644
--- a/packages/code_transformers/test/entry_point_test.dart
+++ b/packages/code_transformers/test/entry_point_test.dart
@@ -2,68 +2,75 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+@TestOn('vm')
library code_transformers.test.assets_test;
import 'dart:async';
import 'package:barback/barback.dart';
import 'package:code_transformers/resolver.dart';
-import 'package:code_transformers/tests.dart';
-import 'package:unittest/compact_vm_config.dart';
-import 'package:unittest/unittest.dart';
+import 'package:transformer_test/utils.dart';
+import 'package:test/test.dart';
main() {
- useCompactVMConfiguration();
-
Future checkDartEntry({Map<String, String> inputs, bool expectation}) {
var transformer = new Validator((transform) {
return isPossibleDartEntry(transform.primaryInput).then((value) {
expect(value, expectation);
});
});
- return applyTransformers([[transformer]], inputs: inputs);
+ return applyTransformers([
+ [transformer]
+ ], inputs: inputs);
}
group('isPossibleDartEntry', () {
test('should handle empty files', () {
- return checkDartEntry(
- inputs: {'a|web/main.dart': '',}, expectation: false);
+ return checkDartEntry(inputs: {
+ 'a|web/main.dart': '',
+ }, expectation: false);
});
test('should detect main methods', () {
- return checkDartEntry(
- inputs: {'a|web/main.dart': 'main() {}',}, expectation: true);
+ return checkDartEntry(inputs: {
+ 'a|web/main.dart': 'main() {}',
+ }, expectation: true);
});
test('should exclude dart mains in lib folder', () {
- return checkDartEntry(
- inputs: {'a|lib/main.dart': 'main() {}',}, expectation: false);
+ return checkDartEntry(inputs: {
+ 'a|lib/main.dart': 'main() {}',
+ }, expectation: false);
});
test('should validate file extension', () {
- return checkDartEntry(
- inputs: {'a|web/main.not_dart': 'main() {}',}, expectation: false);
+ return checkDartEntry(inputs: {
+ 'a|web/main.not_dart': 'main() {}',
+ }, expectation: false);
});
test('should count exports as main', () {
- return checkDartEntry(
- inputs: {'a|web/main.dart': 'export "foo.dart";',},
- expectation: true);
+ return checkDartEntry(inputs: {
+ 'a|web/main.dart': 'export "foo.dart";',
+ }, expectation: true);
});
test('should count parts as main', () {
- return checkDartEntry(
- inputs: {'a|web/main.dart': 'part "foo.dart";',}, expectation: true);
+ return checkDartEntry(inputs: {
+ 'a|web/main.dart': 'part "foo.dart";',
+ }, expectation: true);
});
test('is tolerant of syntax errors with main', () {
- return checkDartEntry(
- inputs: {'a|web/main.dart': 'main() {} {',}, expectation: true);
+ return checkDartEntry(inputs: {
+ 'a|web/main.dart': 'main() {} {',
+ }, expectation: true);
});
test('is tolerant of syntax errors without main', () {
- return checkDartEntry(
- inputs: {'a|web/main.dart': 'class Foo {',}, expectation: false);
+ return checkDartEntry(inputs: {
+ 'a|web/main.dart': 'class Foo {',
+ }, expectation: false);
});
});
}
« no previous file with comments | « packages/code_transformers/test/benchmarks_test.dart ('k') | packages/code_transformers/test/messages_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698