dom_stub 0.0.4 copy "dom_stub: ^0.0.4" to clipboard
dom_stub: ^0.0.4 copied to clipboard

Dart 1 only

Implementing 'dart:js'. It allows to run browser test in VM mode.

dom_stub #

A library for Dart developers. Implementing 'dart:js'. It allows to run browser test in VM mode.

Usage #

Try It Now #

Add the js_mimicry package to your pubspec.yaml file:

dependencies:
  dom_stub: ">=0.0.1 <0.1.0"

Building and Deploying #

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

dart:html support #

Now 'dart:html' library supported via mockito. Usage:

when(window.location.hash).thenReturn('#');
expect(window.location.hash, "#");

At this moment only window object mocked.

replace any import #

transformers:
 - dom_stub:
      imports: { 'browser_cfg.dart': 'vm_cfg.dart' }

Replace 'browser_cfg.dart' to 'vm_cfg.dart'

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

Implementing 'dart:js'. It allows to run browser test in VM mode.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

code_transformers, mockito

More

Packages that depend on dom_stub