Skip to content

Instantly share code, notes, and snippets.

@webpro
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webpro/10625841 to your computer and use it in GitHub Desktop.
Save webpro/10625841 to your computer and use it in GitHub Desktop.
Source/boilerplate example re. Istanbul "include" FR
/* istanbul include next */
function bar() {
//
}
module.exports = {
bar: bar
}
/* istanbul include next */
function baz() {
//
}
module.exports = {
baz: baz
}
! function(e) {
if ("object" == typeof exports) module.exports = e();
else if ("function" == typeof define && define.amd) define(e);
else {
var f;
"undefined" != typeof window ? f = window : "undefined" != typeof global ? f = global : "undefined" != typeof self && (f = self), f.wdgpagegameplayer = e()
}
}(function() {
var define, module, exports;
return (function e(t, n, r) {
function s(o, u) {
if (!n[o]) {
if (!t[o]) {
var a = typeof require == "function" && require;
if (!u && a) return a(o, !0);
if (i) return i(o, !0);
throw new Error("Cannot find module '" + o + "'")
}
var f = n[o] = {
exports: {}
};
t[o][0].call(f.exports, function(e) {
var n = t[o][1][e];
return s(n ? n : e)
}, f, f.exports, e, t, n, r)
}
return n[o].exports
}
var i = typeof require == "function" && require;
for (var o = 0; o < r.length; o++) s(r[o]);
return s
})({
1: [
function(_dereq_, module, exports) {
/* istanbul include next */
function bar() {
//
}
module.exports = {
bar: bar
}
}, {}
],
2: [
function(_dereq_, module, exports) {
/* istanbul include next */
function baz() {
//
}
module.exports = {
baz: baz
}
}, {
"./Dependency": 1
}
],
7: [
function(_dereq_, module, exports) {
// Dependency code not under test (e.g. Underscore)
}, {
"underscore": 8
}
]
}, {}, [6])
(6)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment