- Fix missing
listReplacedModules
#527 - Update quibble
- We missed some versions here, sorry.
- Update quibble to 0.7.0 for Node 20 support quibble#96. Bumping minor for test double because it's a big change to how modules are resolved
- Update typings for version property #515
- Loosen typing file to allow non-Error types to be rejected #511
- Add missing alias to
td.function
for ESM #509
- Swap
global
forglobalThis
#508 - Bump
quibble
to 0.6.17
- Tweak typings again #500
- Update typings around
replace
and related methods #499
- Improve type definition for stubbing a sequence of promises #481
- Update quibble
- Fix
replaceEsm
for the latest release of Node 16, which changed the loader interface. See #474 and quibble#54
- Handle cases where deep-cloning arguments fails. If
cloneArgs
is specified on a stubbing or verification, the error will be propagated and thrown, otherwise it will be swallowed and td.explain will warn the user that clone failed (and therefore its log message may be inaccurate). See #469
- Upgrade quibble to fix ESM replacement
- Add new
td.instance()
method which is a one-liner ofFakeFoo = td.constructor(Foo); new FakeFoo()
#448
- Add support for faking native ES modules with
td.replaceEsm()
#445
- Type updates #437
- Fixes cases where test double objects are passed into
when
orverify
#427
v3.12.4 (2019-08-21)
v3.12.3 (2019-08-04)
Closed issues:
- Destructuring support fail. #424
Merged pull requests:
v3.12.2 (2019-07-16)
Merged pull requests:
v3.12.1 (2019-07-03)
Closed issues:
Merged pull requests:
v3.12.0 (2019-06-08)
Closed issues:
- Challenges testing mutable objects #416
- How to stub out instance methods and replace dependencies when writing a request test? #414
- Mocking Behavior Similar To Rspec: expect to receive and return #413
- How can I verify a call to a stub which is configured to throw? #412
- td.replace a double arrow function #411
- Unable to replace mongoose.model #410
- Cannot test testdoubles inside .then function. #409
- How to test a error subscription #408
- Arguments of mocked functions are saved by reference. #375
Merged pull requests:
v3.11.0 (2019-02-24)
Merged pull requests:
- allow for deeply nested test double objects #407 (searls)
- have the deep nested proxy work with explain #406 (lgandecki)
v3.10.0 (2019-02-02)
Closed issues:
- 2 consecutive 'when(...).thenTrow(...)' expectations crashes #403
- Remove es6-map polyfill #367
- How to mock typescript abstract class? #356
Merged pull requests:
- Remove unnecessary dependency on es6-map. #405 (primarilysnark)
- docs: Correct broken link to testdouble-qunit #404 (jasonmit)
v3.9.3 (2019-01-16)
Merged pull requests:
v3.9.2 (2018-12-31)
Closed issues:
Merged pull requests:
v3.9.1 (2018-11-29)
Closed issues:
Merged pull requests:
v3.9.0 (2018-11-20)
Closed issues:
- There are legitimate cases to use td.verify #389
- TypeError on td.replace('aws-sdk') #388
- Multiple stubs, count wrong? #387
Merged pull requests:
- Add onReset hook. #393 (primarilysnark)
- fix simple typos #392 (lpmi-13)
- feat: Add ava tests examples #385 (pke)
v3.8.2 (2018-10-08)
Implemented enhancements:
- Verifying stubs that return promises without warnings? #245
Closed issues:
- How do I verify only 1 of 2 stubbed functions was called? #384
- Fake timers / mock Date #383
- Getting a not a constructor error when trying to stub an external class dependency #382
- how to handle async callbacks #380
- mocking non-direct dependency #379
- How to replace momentjs ? #378
- testdouble incompatible with coverage tools? #374
- td.replaced module still returning stub after a td.reset() #373
- Awaiting a testdouble function always resolves #371
- Stub one function and use originals for rest #368
- td.replace is breaking type definitions from sanctuary.js #327
Merged pull requests:
- upgrade everything #386 (searls)
- Fix method name typo in README example #369 (jackjennings)
- Update deps #366 (searls)
v3.8.1 (2018-05-05)
Implemented enhancements:
- Better verification messages #161
Closed issues:
- Trouble replacing ES6 classes #365
- You have a global leak:
\_\_core-js\_shared\_\_
#364 - testdouble causes bluebird to emit Unhandled rejection #168
- Should style API of chai.js doesn't always work on test doubles since 1.6.2 #134
v3.8.0 (2018-04-29)
Implemented enhancements:
- Improve td.replace error message for incorrect module path #355
Closed issues:
- td.verify(object.function(new Class("param"))) not asserting "param" #362
- How to Stub a Chained Function #360
- Critical dependency: the request of a dependency is an expression? #354
Merged pull requests:
v3.7.0 (2018-03-31)
Closed issues:
- Compare dates when using td.matchers.contains #358
- verifiable thenThrow #288
- docs: simple page that lists the entire API #253
- Planning Discussion for a move to TypeScript #252
- More support for ES Modules #246
- Consider using _.isObjectLike rather than _.isPlainObject within td.object #224
Merged pull requests:
v3.6.0 (2018-03-24)
Closed issues:
- td.replace a required method? #353
Merged pull requests:
- Export td.quibble #357 (searls)
- Avoid implicit any for TypeScript definitions #351 (rayalan)
- Merge Circle CI config to master #349 (searls)
- Merge in Circle CI config #348 (searls)
v3.5.2 (2018-02-26)
Merged pull requests:
- replace quibble.browser.js with ES5 version #347 (davemo)
- Fixed broken npm install on Windows #345 (duluca)
- Speed up the build #344 (searls)
v3.5.1 (2018-02-25)
Closed issues:
Merged pull requests:
v3.5.0 (2018-02-11)
Closed issues:
- Warn jest users when they call td.replace(moduleName) and point them to testdouble-jest #337
- td.replace doesn't work with Jest #331
Merged pull requests:
v3.4.0 (2018-02-10)
Fixed bugs:
- The webpack example project doesn't work #334
Closed issues:
- Update Getting Started to pass instance object instead of constructor to td.object() #329
Merged pull requests:
- Publicize td.imitate() #336 (searls)
- fix webpack example project #335 (searls)
- Upgrade dependencies, remove yarn #333 (searls)
v3.3.4 (2018-02-09)
Merged pull requests:
- Update readme, move doc outline to docs/ #332 (searls)
- Updated Getting Started to match td.object()'s changes #330 (StanleySathler)
- First draft of issue template #328 (stevenjackson)
- WIP - remove dist from git #299 (jasonkarns)
v3.3.3 (2018-01-18)
Fixed bugs:
- Cannot convert a Symbol value to a string #300
Closed issues:
- Stubbing function from same module under test not replacing real implementation #325
- td.replace does not follow node_modules symlinks since v3.3.2 #324
- td.explain does not work on new instance of td.replace('lib') #323
- td.object(undefined) allowes to call any method #321
- td.replace('mongoose') throws exception #316
Merged pull requests:
- Symbols must be stringified explicitly #301 (jasonkarns)
v3.3.2 (2018-01-16)
Fixed bugs:
- td.replace() on an un-parseable source will claim the module is missing instead of printing the parse error #320
Closed issues:
- thenThrow does not work if stub passed down #319
Merged pull requests:
v3.3.1 (2018-01-05)
v3.3.0 (2017-12-26)
Merged pull requests:
v3.2.7 (2017-12-20)
Fixed bugs:
- Disallow captors in
td.when\(...\)
#308
Closed issues:
- Unexpected output with td.matchers.isA(Function) #307
- Different objects created using the same constructor function obtained using td.constructor share the same stubs #305
- Using invocation verification with QUnit #304
- example tests don't work on latest master #302
- Error when running install inside testdouble.js #298
- Can I use test double with enzyme on client end to test if method runs on button click ? #297
- Node module mocking with td.replace() #294
- replacing a nested dependency does not get reset correctly #293
- How to verify the value of "this" keyword on a call? #292
- How to mock typescript fields #291
Merged pull requests:
- Ensure captors only fire when invocation satisfies when/verify #311 (searls)
- Remove extra word #306 (carlbennettnz)
- Fix example tests #303 (jasonkarns)
- grammar tweak #289 (jasonkarns)
v3.2.6 (2017-09-18)
Merged pull requests:
v3.2.5 (2017-09-07)
Closed issues:
Merged pull requests:
- Upgrade lodash (and support async functions) #285 (rosston)
- Add previous/next links to documentation files #282 (randycoulman)
v3.2.4 (2017-08-06)
Closed issues:
- td.constructor() ReferenceError: td is not defined #279
v3.2.3 (2017-08-01)
Fixed bugs:
- Verifying a td.constructor() fails #278
Closed issues:
- Invocation sequence testing #277
- Cannot assign to read only property 'constructor' after updating to v3.2.x #271
v3.2.2 (2017-06-30)
Implemented enhancements:
- Generator support #273
Merged pull requests:
v3.2.1 (2017-06-26)
Closed issues:
- Tests failing with 'TypeError: Cannot read property 'isPrototypeOf' of null' after updating 3.2.0 #270
v3.2.0 (2017-06-24)
Implemented enhancements:
- Single-layer property replacement is inappropriate for ES modules #262
Closed issues:
- td.constructor() breaks instanceof #267
Merged pull requests:
v3.1.1 (2017-06-20)
v3.1.0 (2017-06-18)
Fixed bugs:
- td.replace throws with objects created with Object.create #257
- getters are executed when using td.constructor() #218
Closed issues:
- Verify that constructor is passed certain values #256
- Is there any sample code that mock aws sdk? #251
- Cannot use
td.object
with "callable objects" #232
Merged pull requests:
- Allow stubbing of custom instances & Object.create() #264 (searls)
- Enable tsc in ci pipeline take 2 #260 (duluca)
- TypeScript typing thenResolve takes variable args #258 (miyu)
- Test testdouble.js with testdouble.js! #255 (searls)
v3.0.0 (2017-06-02)
Fixed bugs:
Closed issues:
td.verify
reporting after resolving promises #250- Replacing dependency with td.replace(path, replacement) doesn't work #249
- Verify constructor #248
- td.replace () breaks the cache in require #244
- Faking internal calls #243
- ECMAScript 2015 Classes with td.constructor() #240
- TypeScript: Better Generic Support for td.object() #236
- How to Replace Imported Constructor in Another File #235
- Mocha Spec Reporter #234
- TypeError: 'x' is not a function #233
- Inifinite recursion problem #231
- Invoke callback within object #230
- Testing Constructor invocations #229
- Stubbing chained API objects yields a warning #228
Merged pull requests:
- Stop extending types when replacing constructors #254 (searls)
- Fix #236; Add another overload and its test #237 (sgtoj)
v2.1.2 (2017-03-29)
Closed issues:
- TypeError when used with node -r flag #226
- When replacing a node library calling it from other modules does not work as expected #225
v2.1.1 (2017-03-28)
Closed issues:
Merged pull requests:
v2.1.0 (2017-03-25)
Closed issues:
- Using td.replace() with external modules #51
Merged pull requests:
v2.0.5 (2017-03-25)
v2.0.4 (2017-03-23)
Closed issues:
constructor\(someConstructorFunction\)
not referenced in associated example #213
Merged pull requests:
v2.0.3 (2017-03-18)
Merged pull requests:
v2.0.2 (2017-03-17)
Closed issues:
- Mocking a constructor function with no prototypes does not correctly mock static methods #208
- Test td.function() after other td fuction() #202
- How do I stub a function that being promisify'd by bluebird? #200
Merged pull requests:
- Preserve function context when calling thenDo #209 (connor4312)
- Decaffeinate #206 (searls)
v2.0.1 (2017-03-13)
v2.0.0 (2017-03-13)
Closed issues:
- How can I write a test for such situation? #199
- contains not working against IIFE objects #192
- td.verify not returning true when true #191
- Typing definition for td.object doesn't support constructors with arguments #184
- Replacing methods on
window.location
#183 - stub also verified warning when using ignoreExtraArgs #181
- [BREAKING] Return constructor for
td.replace\(\)
#166 - Allow matchers inside objects #160
- Support invoking callbacks with arbitrary timing #106
Merged pull requests:
- Async callbacks #205 (searls)
- Create test double functions and copy/fake their properties #204 (searls)
- Support deep matchers #203 (searls)
- introduce td.constructor() as top-level API sibling to td.object() & td.function() #201 (searls)
- Allow Babel compilation #197 (searls)
- Improves warning when verifying a stub #196 (samjonester)
- Yarn #195 (searls)
- Creates Better Verification Message #194 (samjonester)
- Replace constructors with constructors #193 (searls)
v1.11.2 (2017-02-28)
Closed issues:
- Stubbing promises with thenResolve does not actually provide for anything in the callback #189
- sinon.sandbox analog? #188
- Shortcut for new stub returning args #187
- Can't find variable: Proxy #186
Merged pull requests:
- Improve the error message when using Proxy incorrectly. #190 (Schoonology)
v1.11.1 (2017-01-27)
Closed issues:
- Is it possible to
thenReturn
the receiver? #182 - Multiple stubbings with argThat causes unexpected behavior #180
Merged pull requests:
- Update type definition #185 (caseyhoward)
v1.11.0 (2017-01-17)
Closed issues:
- Having something like "verifyNoFurtherInvocations(mock)" would be nice (feature request) #176
Merged pull requests:
v1.10.2 (2016-12-31)
Closed issues:
- Possible pollution issue (2 tests work individually, but fails when run together) #171
- td.verify and td.when redundency warning #170
- Does not work with jest #128
Merged pull requests:
- Captor typings #174 (danielmoore)
- Align TS replace() signuatrue return with implementaiton #173 (danielmoore)
v1.10.1 (2016-12-20)
Implemented enhancements:
- Make the
constructor
property of td.replaced() instantiable types useful #121 - Improve output for
times
verification failures #85 - Allow argument matchers to enhance failure messages #59
- td.constructor() feature for creating fake constructors #54
Closed issues:
- typings for typescript #167
- A little typo in Getting Started documentation #165
- Unable to stub static method on ES6 classes #164
- transcribe unusual spending kata from ES5 to ES6/babel #163
- Classes with overridden methods not doubling properly since 1.10.0 #159
td.replace\(\)
doesn't work withimport
? #147- Support multiple capture invocations #139
- Constructor replacements will fail instanceof checks #107
Merged pull requests:
v1.10.0 (2016-12-11)
Implemented enhancements:
- td.replace doesn't properly detect ES6 classes #119
Closed issues:
- Matcher for a specific position #156
Merged pull requests:
v1.9.1 (2016-12-03)
Implemented enhancements:
- td.replace for functions that have additional function properties #99
Closed issues:
- Is testdouble.js not compatible with PhantomJS? #154
- Model instance creation assistance #149
- Excessive warn "was both stubbed and verified" #148
Merged pull requests:
- Add failing test for resetting replaced modules. #215 (Schoonology)
- typo #152 (ghedamat)
v1.9.0 (2016-10-25)
Implemented enhancements:
- Note when
ignoreExtraArgs
is used for a failed verification #60
Closed issues:
- td.replace multiple property names at once #146
- Consider ignoreExtraArgs method instead of parameter #143
Merged pull requests:
- Gives better hint when verification fails while ignoring extra args #150 (samjonester)
v1.8.0 (2016-10-12)
Closed issues:
- Feature request: Partial object matchers #141
- Drop CoffeeScript #140
- Question with verifications #138
- td.reset() it´s working has expected? #133
Merged pull requests:
- Docs for multiple captor values. #145 (marchaos)
- Allow for multiple captor invocations #144 (marchaos)
- Remove warning of implementations of ES2015 proxy #136 (mgryszko)
- Fix shorthand notation for stubbing #135 (mgryszko)
v1.7.0 (2016-09-18)
Merged pull requests:
v1.6.2 (2016-09-18)
Closed issues:
Merged pull requests:
v1.6.1 (2016-08-31)
Closed issues:
- td.explain should indicate thenCallback / thenResolve / thenReject from thenReturn #126
- td.when and td.verify warning #125
- td.callback, when given a td.object, raises a TypeError #124
- not matcher and calling function multiple times #122
- Verify of a specific call when multiple calls happen #120
Merged pull requests:
- explain plan better in stubbing description #127 (Moeriki)
- Fix typo in plugin name #123 (hanneskaeufler)
v1.6.0 (2016-07-14)
Closed issues:
- Nested stubbing doesn't work #117
Merged pull requests:
v1.5.0 (2016-07-13)
Closed issues:
- support promises resolve/reject #46
Merged pull requests:
- Use stringify-object now that my change is merged #116 (searls)
- Promise stubbing sugar #115 (searls)
v1.4.3 (2016-06-22)
Closed issues:
- Build with Travis on Node 6.x #114
- Wrong test double name for proxies #112
- Improve error output message #111
- Flexible parameters #110
- How can I install and use this in an ember/ember-cli project? #105
- td.replace breaks subsequent require calls #103
Merged pull requests:
v1.4.2 (2016-04-29)
Closed issues:
- matchers.contains(number) support #102
Merged pull requests:
v1.4.1 (2016-04-05)
Closed issues:
- Changelog #97
Merged pull requests:
v1.4.0 (2016-04-03)
Closed issues:
- Reserved word #82
- Warn when users verify an invocation they also stubbed #76
- Feature request: captors without verify #65
Merged pull requests:
v1.3.1 (2016-04-03)
Closed issues:
- Throws in node 0.10 #94
- td.replace() property replacement warning & failure states #92
- give users a way to squelch individual warnings #90
v1.3.0 (2016-04-03)
Closed issues:
- What's the best way to use testdouble.js with tape? #93
- help #91
- td.replace() fails for method on prototype #86
Merged pull requests:
- README: Replace GIFs with code blocks #88 (Turbo87)
- replace: Use object[property] to check if property exists #87 (Turbo87)
v1.2.0 (2016-03-20)
Merged pull requests:
- Stringify objects better #84 (searls)
- doc: thenDo and thenThrow are no longer unimplemented. #83 (verdammelt)
- Refactor time #81 (searls)
v1.1.3 (2016-03-16)
Closed issues:
- Quibble in the browser #77
Merged pull requests:
v1.1.1 (2016-03-15)
Merged pull requests:
v1.1.0 (2016-03-11)
Closed issues:
- Add a property-namespacing-like replace strategy for browsers. #55
Merged pull requests:
- td.replace support for object properties (incl. browsers) #75 (searls)
- td.explain tells you if you passed it a test double #74 (searls)
v1.0.0 (2016-03-10)
Closed issues:
- Document
thenDo
andthenThrow
#64
Merged pull requests:
v0.10.0 (2016-03-09)
Merged pull requests:
v0.9.0 (2016-03-09)
Implemented enhancements:
- Stubbing callbacks #66
Closed issues:
- Getting testdouble.js to play nicely with Jasmine expectations? #41
Merged pull requests:
- Implement callback stubbing APIs #70 (searls)
- fix typo #69 (jzinn)
- Reference the completed testdouble-jasmine module #67 (BrianGenisio)
v0.8.0 (2016-02-06)
Closed issues:
v0.7.3 (2015-12-07)
Implemented enhancements:
- td.matchers.contains does not work on sparse object trees #58
Fixed bugs:
- td.matchers.contains does not work on sparse object trees #58
Merged pull requests:
v0.7.2 (2015-11-25)
Fixed bugs:
- td.matchers.contains blows up on sparse matches #56
Merged pull requests:
- fixes #56 #57 (searls)
- Swap .replace with browser-specific function #52 (jasonkarns)
- Use svg build badge #50 (hanneskaeufler)
v0.7.1 (2015-11-12)
v0.7.0 (2015-11-12)
Closed issues:
- Is there a way to reset the state of a double? #43
Merged pull requests:
- Update README.md #45 (andrewvida)
- Adding reset() to the Readme.md #44 (BrianGenisio)
v0.6.0 (2015-10-27)
Closed issues:
- add ES2015 Proxy support #39
Merged pull requests:
v0.5.0 (2015-10-25)
Closed issues:
- Add verify times() #5
Merged pull requests:
v0.4.0 (2015-10-24)
Closed issues:
Merged pull requests:
v0.3.1 (2015-10-24)
Fixed bugs:
- contains() matcher doesn't seem to work on arrays #31
Closed issues:
- verify does not throw exception when too many arguments are passed #33
- Building CoffeeScript at runtime is slow. #29
Merged pull requests:
- Start checking arity on arg comparisons #34 (searls)
- Compile coffeescript #30 (jasonkarns)
v0.3.0 (2015-10-21)
Closed issues:
- When stringifying args, use a testdouble's name if it has one #21
Merged pull requests:
- Clean up window/global management #28 (jasonkarns)
- clean up package scripts (primarily version) #27 (jasonkarns)
- don't watch generated files #26 (jasonkarns)
- Export
version
property on base object #25 (jasonkarns) - Fixes #21 #24 (searls)
v0.2.0 (2015-09-13)
Closed issues:
- Add a build task that distributes a web version / bower.json / etc #10
Merged pull requests:
- Browserify testing #22 (searls)
- add some more syntax highlighting to README #20 (hanneskaeufler)
- Configure Testem #19 (jasonkarns)
- Browserify #13 (jasonkarns)
v0.1.0 (2015-09-09)
Closed issues:
- name a test double with
create\("name"\)
#15 - Implement default matchers #9
- Add sequential stubbing #6
- Implement Prototype for create() #2
- Implement argument matchers #1
Merged pull requests:
- Test prototype-based create() #18 (searls)
- Allow naming test doubles for better output #17 (searls)
- sequential stubbing #16 (searls)
- add more matchers #14 (searls)
v0.0.5 (2015-09-08)
Closed issues:
- Add
verify\(\)
#4
0.0.4 (2015-09-08)
0.0.3 (2015-09-08)
Closed issues:
- Print version in browserify build #23
- Add a
require\('testdouble'\).explain
function #12 - Ensure last stubbing wins #11