Skip to content

kossnocorp/playground-test-helpers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

playground-test-helpers

DOM playground test helpers.

Installation

npm install playground-test-helpers --save-dev

Example

Use with Mocha or Jasmine:

var PlaygroundTestHelpers = require('playground-test-helpers')
var React = require('react')
var Button = require('.')

describe('Button', function() {
  // Get clean <div id='playground'></div> before each test
  PlaygroundTestHelpers.prepareFilter()

  it('renders button', function() {
    var playground = PlaygroundTestHelpers.get()
    React.render(React.createElement(Button), playground)
    assert(playground.querySelector('button'))
  })
})

License

MIT

About

DOM playground test helpers

Resources

Stars

Watchers

Forks

Packages

No packages published