Created
April 13, 2016 10:02
-
-
Save peduarte/eb400127901183e9961a290d5681b1ba to your computer and use it in GitHub Desktop.
jsdom + enzyme + ava
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install --save-dev jsdom | |
// test-browser-env.js | |
import { jsdom } from 'jsdom'; | |
global.document = jsdom('<body></body>'); | |
global.window = document.defaultView; | |
global.navigator = window.navigator; | |
// package.json | |
"ava": { | |
"require": [ | |
"./test-browser-env.js" | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks @peduarte,
everybody else can find a updated and working example here: https://gist.github.com/pablopaul/2d4bba03d9a1215061b0f4a9390c6b81