enzyme
Version:
JavaScript Testing utilities for React
42 lines (39 loc) • 925 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.describeWithDOM = describeWithDOM;
exports.describeIf = describeIf;
exports.itIf = itIf;
function describeWithDOM(a, b) {
describe('(uses jsdom)', function () {
if (global.document) {
describe(a, b);
} else {
// if jsdom isn't available, skip every test in this describe context
describe.skip(a, b);
}
});
}
/**
* Simple wrapper around mocha describe which allows a boolean to be passed in first which
* determines whether or not the test will be run
*/
function describeIf(test, a, b) {
if (test) {
describe(a, b);
} else {
describe.skip(a, b);
}
}
/**
* Simple wrapper around mocha it which allows a boolean to be passed in first which
* determines whether or not the test will be run
*/
function itIf(test, a, b) {
if (test) {
it(a, b);
} else {
it.skip(a, b);
}
}