td
test-dom
npm i test-dom
td

test-dom

Caleb Meredith‘s convenience monorepo for modules he maintains

by Caleb Meredith

1.0.0 (see all)License:MITTypeScript:Not Found
npm i test-dom
Readme

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

Downloads/wk

3

GitHub Stars

40

LAST COMMIT

6yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

4

OPEN PRs

4
VersionTagPublished
1.0.0
latest
6yrs ago
No alternatives found
No tutorials found
Add a tutorial