testdouble
Advanced tools
Comparing version 3.16.0 to 3.16.1
# Change Log | ||
## 3.15 | ||
## 3.16.0 | ||
* Add new `td.instance()` method which is a one-liner of `FakeFoo = td.constructor(Foo); new FakeFoo()` [#448](https://github.com/testdouble/testdouble.js/pull/448) | ||
## 3.15.0 | ||
* Add support for faking native ES modules with `td.replaceEsm()` [#445](https://github.com/testdouble/testdouble.js/pull/445) | ||
## 3.14 | ||
## 3.14.0 | ||
@@ -9,0 +13,0 @@ * Type updates [#437](https://github.com/testdouble/testdouble.js/pull/437) |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = '3.16.0'; | ||
exports.default = '3.16.1'; |
{ | ||
"name": "testdouble", | ||
"version": "3.16.0", | ||
"version": "3.16.1", | ||
"description": "A minimal test double library for TDD with JavaScript", | ||
@@ -97,3 +97,3 @@ "homepage": "https://github.com/testdouble/testdouble.js", | ||
"lodash": "^4.17.15", | ||
"quibble": "^0.6.3", | ||
"quibble": "^0.6.4", | ||
"stringify-object-es5": "^2.5.0", | ||
@@ -100,0 +100,0 @@ "theredoc": "^1.0.0" |
@@ -337,12 +337,10 @@ # testdouble.js (AKA td.js) | ||
If your code depends on ES classes or functions, then the `td.instance()` function | ||
will create a mock constructor and return a new instance of that mock constructor. | ||
As a shorthand convenience, `td.instance()` function will call | ||
`td.constructor()` and return a `new` instance of the fake constructor function | ||
it returns. | ||
The following code snippets are functionally equiavalent: | ||
The following code snippets are functionally equivalent: | ||
```js | ||
const fakeObject = td.instance(RealConstructor) | ||
td.when(fakeObject.doStuff()).thenReturn('just did it') | ||
fakeObject.doStuff() // returns "just did it" | ||
``` | ||
@@ -353,5 +351,2 @@ | ||
const fakeObject = new FakeConstructor() | ||
td.when(fakeObject.doStuff()).thenReturn('just did it') | ||
fakeObject.doStuff() // returns "just did it" | ||
``` | ||
@@ -358,0 +353,0 @@ |
@@ -1,1 +0,1 @@ | ||
export default '3.16.0' | ||
export default '3.16.1' |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
516847
580
Updatedquibble@^0.6.4