2 + 2 = 5 Should Be Red

Client-side Dart code must be tested in a running Dart-enabled browser or headless context. A simple web page is required to host the test output. Any old HTML will suffice as long as it does the following:

  • Pulls in the Dart tests

  • Starts the Dart engine

The dummy test page for testing the HipsterCollection class will be as follows:

<title>​Hipster Test Suite​</title>
<script​ type=​"application/dart"
<script​ type=​"text/javascript"​​>
navigator.webkitStartDart(); // start Dart

We rely on HipsterCollectionTest.dart to import two required ...

Get Dart 1 for Everyone now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.