जेस्ट में, टेस्ट कवरेज के लिए कोड को अनदेखा करने का कोई तरीका है? मैंने प्रयोग करने की कोशिश की
/* istanbul ignore next */
लेकिन यह काम नहीं करता है।
उत्तर:
उत्तर № 1 के लिए 4यह काम करता हैं।
(function(global) {
var defineAsGlobal = true;
/* istanbul ignore next */
if(typeof exports === "object") {
module.exports = lib;
defineAsGlobal = false;
}
/* istanbul ignore next */
if(typeof modules === "object" && typeof modules.define === "function") {
modules.define("lib", function(provide) {
provide(lib);
});
defineAsGlobal = false;
}
/* istanbul ignore next */
if(typeof define === "function") {
define(function(require, exports, module) {
module.exports = lib;
});
defineAsGlobal = false;
}
/* istanbul ignore next */
defineAsGlobal && (global.lib = lib);
})(this);
नमूना परियोजना https://github.com/ilyar/sandbox/tree/master/jest