14
Trong Jest, có cách nào để bỏ qua mã cho phạm vi kiểm tra không? Tôi đã thử sử dụngJest: Bỏ qua các dòng mã bảo hiểm
/* istanbul ignore next */
Nhưng dường như nó không hoạt động.
Trong Jest, có cách nào để bỏ qua mã cho phạm vi kiểm tra không? Tôi đã thử sử dụngJest: Bỏ qua các dòng mã bảo hiểm
/* istanbul ignore next */
Nhưng dường như nó không hoạt động.
Nó hoạt động.
(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);