UNPKG

@kamiazya/jest-dynamic

Version:

An extension to dynamically switch the Jest test suite according to the environment (such as platform).

2 lines (1 loc) 680 B
"use strict";function e(e){switch(e){case"only":case"skip":return{describe:describe[e],test:test[e],it:it[e]};default:return{describe:describe,test:test,it:it}}}Object.defineProperty(exports,"__esModule",{value:!0});var t={base:e(),skip:e("skip"),only:e("only")};function r(e){return"boolean"==typeof e?e:e()}function s(e){return r(e)?t.skip:t.base}function n(e){return r(e)?t.only:t.base}exports.onlyIf=n,exports.onlyOn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e.includes(process.platform);return n(r)},exports.skipIf=s,exports.skipOn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return s(e.includes(process.platform))};