1.0.0 • Published 8 years ago

test-dom v1.0.0

Weekly downloads
25
License
MIT
Repository
github
Last release
8 years ago

test-dom

Ever wanted to test your React or other DOM based app in Node.js? Well luckily there is this great library called JSDOM that lets you interact with DOM structures in a Node.js environment. This package globally exposes an instance of JSDOM when required making it super easy to use in your tests. Just:

// Require…
require('test-dom')

// …and profit!
document.createElement('div')

The library itself is under 20 lines of code. This is it:

var jsdom = require('jsdom').jsdom
var window = jsdom('<body></body>').defaultView
global.window = window
global.document = window.document
global.navigator = window.navigator
1.0.0

8 years ago

0.0.1

9 years ago