Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
jsdom + enzyme + ava
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"
]
}
@flubox

This comment has been minimized.

Copy link

commented Apr 7, 2017

thanks :)

@pablopaul

This comment has been minimized.

Copy link

commented Aug 30, 2017

thanks @peduarte,

everybody else can find a updated and working example here: https://gist.github.com/pablopaul/2d4bba03d9a1215061b0f4a9390c6b81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.