|
1 | 1 | /*
|
2 |
| - |
| 2 | + |
3 | 3 | *
|
4 | 4 | * A minimal test double library for TDD with JavaScript
|
5 | 5 | *
|
@@ -9748,34 +9748,22 @@ var _imitate2 = _interopRequireDefault(_imitate);
|
9748 | 9748 |
|
9749 | 9749 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
9750 | 9750 |
|
9751 |
| -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
9752 |
| - |
9753 | 9751 | exports.default = function (typeOrNames) {
|
9754 | 9752 | return _lodashWrap2.default.isFunction(typeOrNames) ? (0, _imitate2.default)(typeOrNames) : fakeConstructorFromNames(typeOrNames);
|
9755 | 9753 | };
|
9756 | 9754 |
|
9757 | 9755 | 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 | + |
9761 | 9761 | _lodashWrap2.default.each(funcNames, function (funcName) {
|
9762 |
| - cls.prototype[funcName] = (0, _function2.default)('#' + funcName); |
| 9762 | + fakeConstructor.prototype[funcName] = (0, _function2.default)('#' + funcName); |
9763 | 9763 | });
|
9764 |
| - |
9765 |
| - addToStringMethodsToFakeType(cls); |
9766 | 9764 | });
|
9767 | 9765 | };
|
9768 | 9766 |
|
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 |
| - |
9779 | 9767 | },{"./function":303,"./imitate":305,"./util/lodash-wrap":337}],302:[function(require,module,exports){
|
9780 | 9768 | 'use strict';
|
9781 | 9769 |
|
@@ -11343,7 +11331,7 @@ var ignoreMessage = function ignoreMessage(config) {
|
11343 | 11331 | Object.defineProperty(exports, "__esModule", {
|
11344 | 11332 | value: true
|
11345 | 11333 | });
|
11346 |
| -exports.default = '3.2.2'; |
| 11334 | +exports.default = '3.2.3'; |
11347 | 11335 |
|
11348 | 11336 | },{}],336:[function(require,module,exports){
|
11349 | 11337 | 'use strict';
|
|
0 commit comments