testdouble
Version:
A minimal test double library for TDD with JavaScript
13 lines (12 loc) • 409 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const lodash_1 = require("../../wrap/lodash");
function fakeName(path, realThing) {
return `${path}: ${nameFor(realThing)}`;
}
exports.default = fakeName;
const nameFor = (realThing) => {
if (!lodash_1.default.isFunction(realThing))
return '';
return realThing.name ? realThing.name : '(anonymous function)';
};
;