Skip to content

geowarin/describe-with-domino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>');
  })
});

About

Wraps mocha's describe function with domino and cleans up globals afterwards.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published