Skip to content

Commit 80dce49

Browse files
committed
3.2.3
1 parent ebe5796 commit 80dce49

File tree

3 files changed

+10
-22
lines changed

3 files changed

+10
-22
lines changed

dist/testdouble.js

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
2+
33
*
44
* A minimal test double library for TDD with JavaScript
55
*
@@ -9748,34 +9748,22 @@ var _imitate2 = _interopRequireDefault(_imitate);
97489748

97499749
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
97509750

9751-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9752-
97539751
exports.default = function (typeOrNames) {
97549752
return _lodashWrap2.default.isFunction(typeOrNames) ? (0, _imitate2.default)(typeOrNames) : fakeConstructorFromNames(typeOrNames);
97559753
};
97569754

97579755
var fakeConstructorFromNames = function fakeConstructorFromNames(funcNames) {
9758-
return _lodashWrap2.default.tap(function TestDoubleConstructor() {
9759-
_classCallCheck(this, TestDoubleConstructor);
9760-
}, function (cls) {
9756+
return _lodashWrap2.default.tap(td.function('(unnamed constructor)'), function (fakeConstructor) {
9757+
fakeConstructor.prototype.toString = function () {
9758+
return '[test double instance of constructor]';
9759+
};
9760+
97619761
_lodashWrap2.default.each(funcNames, function (funcName) {
9762-
cls.prototype[funcName] = (0, _function2.default)('#' + funcName);
9762+
fakeConstructor.prototype[funcName] = (0, _function2.default)('#' + funcName);
97639763
});
9764-
9765-
addToStringMethodsToFakeType(cls);
97669764
});
97679765
};
97689766

9769-
var addToStringMethodsToFakeType = function addToStringMethodsToFakeType(fakeType, name) {
9770-
fakeType.toString = function () {
9771-
return '[test double constructor' + (name ? ' for "' + name + '"' : '') + ']';
9772-
};
9773-
9774-
fakeType.prototype.toString = function () {
9775-
return '[test double instance of constructor' + (name ? ' "' + name + '"' : '') + ']';
9776-
};
9777-
};
9778-
97799767
},{"./function":303,"./imitate":305,"./util/lodash-wrap":337}],302:[function(require,module,exports){
97809768
'use strict';
97819769

@@ -11343,7 +11331,7 @@ var ignoreMessage = function ignoreMessage(config) {
1134311331
Object.defineProperty(exports, "__esModule", {
1134411332
value: true
1134511333
});
11346-
exports.default = '3.2.2';
11334+
exports.default = '3.2.3';
1134711335

1134811336
},{}],336:[function(require,module,exports){
1134911337
'use strict';

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "testdouble",
3-
"version": "3.2.2",
3+
"version": "3.2.3",
44
"description": "A minimal test double library for TDD with JavaScript",
55
"homepage": "https://github.com/testdouble/testdouble.js",
66
"author": {

src/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export default '3.2.2'
1+
export default '3.2.3'

0 commit comments

Comments
 (0)