describe-with-domino

1.0.0 • Public • Published

describe-with-domino

Wraps mocha's describe function with domino (a lightweight alternative to JSDom) and cleans up globals afterwards.

Works great with enzyme.

Usage

"use strict";

const describeWithDomino = require('describe-with-domino');
const expect = require('expect');

describeWithDomino('this test has access to the dom', function() {
  it('should access to the dom', function() {
    expect(document).toExist();

    var div = document.createElement('div');
    div.innerHTML = 'hello';
    document.body.appendChild(div);
    expect(document.querySelector('body').innerHTML).toEqual('<div>hello</div>');
  })
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    3

Package Sidebar

Install

npm i describe-with-domino

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • geowarin