A library for Dart developers. Implementing 'dart:js'. It allows to run browser test in VM mode.
Add the js_mimicry package to your pubspec.yaml file:
dependencies:
dom_stub: ">=0.0.1 <0.1.0"
To build a deployable version of your test, add the dom_stub transformers to your pubspec.yaml file:
transformers:
- dom_stub
A simple usage example:
DOM_STUB="true" pub serve
pub run test --pub-serve=8080 -p vm
Now 'dart:html' library supported via mockito. Usage:
when(window.location.hash).thenReturn('#');
expect(window.location.hash, "#");
At this moment only window object mocked.
transformers:
- dom_stub:
imports: { 'browser_cfg.dart': 'vm_cfg.dart' }
Replace 'browser_cfg.dart' to 'vm_cfg.dart'
Please file feature requests and bugs at the issue tracker.