UNPKG

enzyme

Version:

JavaScript Testing utilities for React

53 lines (47 loc) 1.16 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.describeWithDOM = describeWithDOM; var jsdom = undefined; try { require('jsdom'); // could throw jsdom = require('mocha-jsdom'); } catch (e) { // jsdom is not supported... } function describeWithDOM(a, b) { describe('(uses jsdom)', function () { if (typeof jsdom === 'function') { jsdom(); describe(a, b); } else { // if jsdom isn't available, skip every test in this describe context describe.skip(a, b); } }); } function only(a, b) { describe('(uses jsdom)', function () { if (typeof jsdom === 'function') { jsdom(); describe.only(a, b); } else { // if jsdom isn't available, skip every test in this describe context describe.skip(a, b); } }); } function skip(a, b) { describe('(uses jsdom)', function () { if (typeof jsdom === 'function') { jsdom(); describe.skip(a, b); } else { // if jsdom isn't available, skip every test in this describe context describe.skip(a, b); } }); } describeWithDOM.only = only; describeWithDOM.skip = skip;