2017-12-06 5 views
0

ich klonen das Beispielprojekt aus https://github.com/angular-examples/toh-6.gitWie werden Winkeltests durchgeführt?

  1. erhielt Abhängigkeiten:

    pub

  2. Versuchen erhalten Tests auszuführen:

    pub Lauf angular_test --test-arg = - tags = aot --test-arg = - plattform = dartium --test-arg = - reporter = erweitert --verbose

Outpu:

PS Z:\Web\Test\dart_angular\external\toh-6> pub run angular_test --test-arg=--tags=aot --test-arg=--platform=dartium --test-arg=--reporter=expanded --verbose 
pub.bat serve test --port=0 
Loading source assets... 
Loading angular, test/pub_serve and dart_to_js_script_rewriter transformers... 
Pub "serve" started on http://localhost:52953 
Serving angular_tour_of_heroes test on http://localhost:52953 
Finished compilation. Running tests... 
pub.bat run test --tags=aot --platform=dartium --reporter=expanded --pub-serve=52953 
00:00 +0: test\app_test.dart: (suite) 
Skip: AppComponent tests need bootstrap equivalent for the Router init 
00:00 +0 ~1: loading test\all_test.dart 
00:00 +0 ~1 -1: loading test\all_test.dart [E] 
Failed to load "test\all_test.dart": 
Failed to run Dartium: Не удается найти указанный файл. 


Command: dartium.exe --user-data-dir=C:\Users\k.ponomarev\AppData\Local\Temp\dart_test_e20a0131-da5c-11e7-9d6f-902b34b6196e http://localhost:52953/packages/test/src/runner/browser/static/index.html?managerUrl=ws%3A%2F%2Flocalhost%3A52956%2FmFXmvlRej%252BuoXwBhtyWjm1u67DweMIM9%2F0&debug=false --disable-extensions --disable-popup-blocking --bwsi --no-first-run --no-default-browser-check --disable-default-apps --disable-translate. 
dart:async/future_impl.dart 22        _Completer.completeError 
dart:io-patch/process_patch.dart 412      _ProcessImpl._start.<fn> 
package:stack_trace/src/stack_zone_specification.dart 209 StackZoneSpecification._run 
package:stack_trace/src/stack_zone_specification.dart 119 StackZoneSpecification._registerCallback.<fn> 
dart:async/zone.dart 1116         _rootRun 
dart:async/zone.dart 1001         _CustomZone.run 
dart:async/zone.dart 901         _CustomZone.runGuarded 
dart:async/zone.dart 926         _CustomZone.bindCallback.<fn> 
package:stack_trace/src/stack_zone_specification.dart 209 StackZoneSpecification._run 
package:stack_trace/src/stack_zone_specification.dart 119 StackZoneSpecification._registerCallback.<fn> 
dart:async/zone.dart 1120         _rootRun 
dart:async/zone.dart 1001         _CustomZone.run 
dart:async/zone.dart 901         _CustomZone.runGuarded 
dart:async/zone.dart 926         _CustomZone.bindCallback.<fn> 
dart:async-patch/timer_patch.dart 21      Timer._createTimer.<fn> 
dart:isolate-patch/timer_impl.dart 366      _Timer._runTimers 
dart:isolate-patch/timer_impl.dart 394      _Timer._handleMessage 
dart:isolate-patch/isolate_patch.dart 151     _RawReceivePortImpl._handleMessage 
===== asynchronous gap =========================== 
dart:async/zone.dart 1034         _CustomZone.registerCallback 
dart:async/zone.dart 924         _CustomZone.bindCallback 
dart:async/timer.dart 52         new Timer 
dart:async/timer.dart 90         Timer.run 
dart:io-patch/process_patch.dart 392      _ProcessImpl._start 
dart:io-patch/process_patch.dart 34      Process.start 
package:test/src/runner/browser/dartium.dart 66   new Dartium.<fn>.<fn> 
===== asynchronous gap =========================== 
dart:async/zone.dart 1034         _CustomZone.registerCallback 
dart:async/zone.dart 924         _CustomZone.bindCallback 
dart:async/schedule_microtask.dart 148      scheduleMicrotask 
dart:async/future.dart 182         new Future.microtask 
package:test/src/runner/browser/dartium.dart 40   new Dartium.<fn>.<fn> 
package:test/src/runner/browser/dartium.dart 119   new Dartium.<fn> 
===== asynchronous gap =========================== 

.... 

[test] GET all_test.dart.browser_test.dart => angular_tour_of_heroes|test/all_test.dart.browser_test.dart 
00:00 +0 ~1 -1: Some tests failed. 
Shutting down... 
`pub serve` w 

Wie richtig Winkel Tests laufen?

Antwort

0

Ich fand Lösung meines Problems. Der Test kann die Datei dartium.exe nicht starten. Um es zu beheben:

  1. Fügen Sie c: \ tools \ dartium zum PATH hinzu.
  2. erstellen Symbol Link dartium.exe lounche chrome.exe

    mklink dartium.exe c: \ tools \ dartium \ chrome.exe

ich zwei Ansatz Tests starten:

  1. laufen zwei Befehle in verschiedener Konsole

    pub dienen

    pub Lauftest --pub-serve = 8081 -p dartium

  2. Wie in (example):

    pub Lauf angular_test --test-arg = - tags = aot --test argument = - Plattform = Dartium - Test-Arg = - Reporter = erweitert - Verbose

Verwandte Themen