dom_stub 0.0.4

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 30

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.

Changelog

0.0.4

  • upgrade code_transformers >=0.4.2 <0.4.3

0.0.3

  • implemented replacing in export

0.0.2

  • custom import replacing via pubspec.yaml
  • 'dart:html' library supported via mockito

0.0.1

  • Initial version, support 'dart:js'

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dom_stub: "^0.0.4"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dom_stub/dom_stub.dart';
        
Version Uploaded Documentation Archive
0.0.4 Apr 1, 2016 Go to the documentation of dom_stub 0.0.4 Download dom_stub 0.0.4 archive
0.0.3 Aug 21, 2015 Go to the documentation of dom_stub 0.0.3 Download dom_stub 0.0.3 archive
0.0.2 Jun 28, 2015 Go to the documentation of dom_stub 0.0.2 Download dom_stub 0.0.2 archive
0.0.1+1 Jun 21, 2015 Go to the documentation of dom_stub 0.0.1+1 Download dom_stub 0.0.1+1 archive
0.0.1 Jun 21, 2015 Go to the documentation of dom_stub 0.0.1 Download dom_stub 0.0.1 archive

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Feb 16, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
15 / 100
Health:
Code health derived from static analysis. [more]
69 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
10 / 100
Overall score:
Weighted score of the above. [more]
30

Platforms

Detected platforms: web, other

Primary library: package:dom_stub/dom_stub.dart with components: mirrors.

Suggestions

  • Fix lib/src/js/js_array.dart.

    Strong-mode analysis of lib/src/js/js_array.dart failed with the following error:

    line: 38 col: 3
    Invalid override. The type of 'JsArray.[]=' ('(dynamic, E) → void') isn't a subtype of 'JsObject.[]=' ('(dynamic, dynamic) → void').

  • Fix lib/src/js/js_object.dart.

    Strong-mode analysis of lib/src/js/js_object.dart failed with the following error:

    line: 44 col: 12
    The method '_fromBrowserObject' isn't defined for the class 'JsObject'.

  • Fix further 1 Dart files.

    Similar analysis of the following files failed:

    • lib/transformer.dart
  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 3 error(s) and 0 warning(s).

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use dom_stub.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.9.3 <2.0.0
code_transformers >=0.4.2 <0.4.3 0.4.2+4 0.5.1+4
mockito >=0.10.0 <0.11.0 0.10.1 2.2.3
Transitive dependencies
analyzer 0.29.11 0.31.1
args 0.13.7 1.3.0
async 2.0.3 2.0.4
barback 0.15.2+14
boolean_selector 1.0.2
charcode 1.1.1
cli_util 0.0.1+2 0.1.2+1
collection 1.14.5
convert 2.0.1
crypto 2.0.2+1
csslib 0.14.1
glob 1.1.5
html 0.13.2+2
http 0.11.3+16
http_multi_server 2.0.4
http_parser 3.1.1
io 0.3.2+1
isolate 1.1.0
js 0.6.1
logging 0.11.3+1
matcher 0.12.1+4
meta 1.1.2
mime 0.9.6
multi_server_socket 1.0.1
node_preamble 1.4.0
package_config 1.0.3
package_resolver 1.0.2
path 1.5.1
plugin 0.2.0+2
pool 1.3.4
pub_semver 1.3.2
shelf 0.7.2
shelf_packages_handler 1.0.3
shelf_static 0.2.7
shelf_web_socket 0.2.2
source_map_stack_trace 1.1.4
source_maps 0.10.4
source_span 1.4.0
stack_trace 1.9.2
stream_channel 1.6.3
string_scanner 1.0.2
term_glyph 1.0.0
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+7
web_socket_channel 1.0.6 1.0.7
when 0.2.0
which 0.1.3
yaml 2.1.13
Dev dependencies
test >=0.12.0 <0.13.0 0.12.30+3