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

Side by Side Diff: test/runner/json_reporter_test.dart

Issue 1887853002: Add a LiveSuite class. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Code review changes Created 4 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 unified diff | Download patch
« no previous file with comments | « test/runner/configuration/top_level_test.dart ('k') | test/runner/pub_serve_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 @TestOn("vm") 5 @TestOn("vm")
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 8
9 import 'package:scheduled_test/descriptor.dart' as d; 9 import 'package:scheduled_test/descriptor.dart' as d;
10 import 'package:scheduled_test/scheduled_stream.dart'; 10 import 'package:scheduled_test/scheduled_stream.dart';
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 406
407 d.file("test.dart", dart).create(); 407 d.file("test.dart", dart).create();
408 408
409 var test = runTest(["test.dart"], reporter: "json"); 409 var test = runTest(["test.dart"], reporter: "json");
410 test.shouldExit(); 410 test.shouldExit();
411 411
412 schedule(() async { 412 schedule(() async {
413 var stdoutLines = await test.stdoutStream().toList(); 413 var stdoutLines = await test.stdoutStream().toList();
414 414
415 expect(stdoutLines.length, equals(expected.length), 415 expect(stdoutLines.length, equals(expected.length),
416 reason: "Expected $stdoutLines to match $expected."); 416 reason: "Expected $stdoutLines to match ${JSON.encode(expected)}.");
417 417
418 // TODO(nweiz): validate each event against the JSON schema when 418 // TODO(nweiz): validate each event against the JSON schema when
419 // patefacio/json_schema#4 is merged. 419 // patefacio/json_schema#4 is merged.
420 420
421 // Remove excess trailing whitespace. 421 // Remove excess trailing whitespace.
422 for (var i = 0; i < stdoutLines.length; i++) { 422 for (var i = 0; i < stdoutLines.length; i++) {
423 var event = JSON.decode(stdoutLines[i]); 423 var event = JSON.decode(stdoutLines[i]);
424 expect(event.remove("time"), new isInstanceOf<int>()); 424 expect(event.remove("time"), new isInstanceOf<int>());
425 event.remove("stackTrace"); 425 event.remove("stackTrace");
426 expect(event, equals(expected[i])); 426 expect(event, equals(expected[i]));
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
543 /// Returns the serialized metadata corresponding to [skip]. 543 /// Returns the serialized metadata corresponding to [skip].
544 Map _metadata({skip}) { 544 Map _metadata({skip}) {
545 if (skip == true) { 545 if (skip == true) {
546 return {"skip": true, "skipReason": null}; 546 return {"skip": true, "skipReason": null};
547 } else if (skip is String) { 547 } else if (skip is String) {
548 return {"skip": true, "skipReason": skip}; 548 return {"skip": true, "skipReason": skip};
549 } else { 549 } else {
550 return {"skip": false, "skipReason": null}; 550 return {"skip": false, "skipReason": null};
551 } 551 }
552 } 552 }
OLDNEW
« no previous file with comments | « test/runner/configuration/top_level_test.dart ('k') | test/runner/pub_serve_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698