Skip to content

Commit f06f6b0

Browse files
author
Brian Ojeda
committed
merge master fix one conflict
2 parents e86769c + 73f27b8 commit f06f6b0

File tree

126 files changed

+6696
-2559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+6696
-2559
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ npm-debug.log*
1212
/coverage
1313

1414
.node-version
15+
.vscode

CHANGELOG.md

Lines changed: 120 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,132 @@
11
# Change Log
22

3+
## [v3.2.5](https://github.com/testdouble/testdouble.js/tree/v3.2.5) (2017-09-07)
4+
[Full Changelog](https://github.com/testdouble/testdouble.js/compare/v3.2.4...v3.2.5)
5+
6+
**Closed issues:**
7+
8+
- Missing support for async functions? \(Node 8\) [\#284](https://github.com/testdouble/testdouble.js/issues/284)
9+
- redacted [\#283](https://github.com/testdouble/testdouble.js/issues/283)
10+
- Stubbing priority [\#280](https://github.com/testdouble/testdouble.js/issues/280)
11+
12+
**Merged pull requests:**
13+
14+
- Upgrade lodash \(and support async functions\) [\#285](https://github.com/testdouble/testdouble.js/pull/285) ([rosston](https://github.com/rosston))
15+
- Add previous/next links to documentation files [\#282](https://github.com/testdouble/testdouble.js/pull/282) ([randycoulman](https://github.com/randycoulman))
16+
17+
## [v3.2.4](https://github.com/testdouble/testdouble.js/tree/v3.2.4) (2017-08-06)
18+
[Full Changelog](https://github.com/testdouble/testdouble.js/compare/v3.2.3...v3.2.4)
19+
20+
**Closed issues:**
21+
22+
- td.constructor\(\) ReferenceError: td is not defined [\#279](https://github.com/testdouble/testdouble.js/issues/279)
23+
24+
## [v3.2.3](https://github.com/testdouble/testdouble.js/tree/v3.2.3) (2017-08-01)
25+
[Full Changelog](https://github.com/testdouble/testdouble.js/compare/v3.2.2...v3.2.3)
26+
27+
**Fixed bugs:**
28+
29+
- Verifying a td.constructor\(\) fails [\#278](https://github.com/testdouble/testdouble.js/issues/278)
30+
31+
**Closed issues:**
32+
33+
- Invocation sequence testing [\#277](https://github.com/testdouble/testdouble.js/issues/277)
34+
- Cannot assign to read only property 'constructor' after updating to v3.2.x [\#271](https://github.com/testdouble/testdouble.js/issues/271)
35+
36+
## [v3.2.2](https://github.com/testdouble/testdouble.js/tree/v3.2.2) (2017-06-30)
37+
[Full Changelog](https://github.com/testdouble/testdouble.js/compare/v3.2.1...v3.2.2)
38+
39+
**Implemented enhancements:**
40+
41+
- Generator support [\#273](https://github.com/testdouble/testdouble.js/issues/273)
42+
43+
**Merged pull requests:**
44+
45+
- Don't blow up when imitating a thing with generators on it [\#274](https://github.com/testdouble/testdouble.js/pull/274) ([searls](https://github.com/searls))
46+
47+
## [v3.2.1](https://github.com/testdouble/testdouble.js/tree/v3.2.1) (2017-06-26)
48+
[Full Changelog](https://github.com/testdouble/testdouble.js/compare/v3.2.0...v3.2.1)
49+
50+
**Closed issues:**
51+
52+
- Tests failing with 'TypeError: Cannot read property 'isPrototypeOf' of null' after updating 3.2.0 [\#270](https://github.com/testdouble/testdouble.js/issues/270)
53+
54+
## [v3.2.0](https://github.com/testdouble/testdouble.js/tree/v3.2.0) (2017-06-24)
55+
[Full Changelog](https://github.com/testdouble/testdouble.js/compare/v3.1.1...v3.2.0)
56+
57+
**Implemented enhancements:**
58+
59+
- Single-layer property replacement is inappropriate for ES modules [\#262](https://github.com/testdouble/testdouble.js/issues/262)
60+
61+
**Closed issues:**
62+
63+
- td.constructor\(\) breaks instanceof [\#267](https://github.com/testdouble/testdouble.js/issues/267)
64+
65+
**Merged pull requests:**
66+
67+
- imitate / replace things deeply \(instead of shallow\) [\#268](https://github.com/testdouble/testdouble.js/pull/268) ([searls](https://github.com/searls))
68+
69+
## [v3.1.1](https://github.com/testdouble/testdouble.js/tree/v3.1.1) (2017-06-20)
70+
[Full Changelog](https://github.com/testdouble/testdouble.js/compare/v3.1.0...v3.1.1)
71+
72+
## [v3.1.0](https://github.com/testdouble/testdouble.js/tree/v3.1.0) (2017-06-18)
73+
[Full Changelog](https://github.com/testdouble/testdouble.js/compare/v3.0.0...v3.1.0)
74+
75+
**Fixed bugs:**
76+
77+
- td.replace throws with objects created with Object.create [\#257](https://github.com/testdouble/testdouble.js/issues/257)
78+
- getters are executed when using td.constructor\(\) [\#218](https://github.com/testdouble/testdouble.js/issues/218)
79+
80+
**Closed issues:**
81+
82+
- Verify that constructor is passed certain values [\#256](https://github.com/testdouble/testdouble.js/issues/256)
83+
- Is there any sample code that mock aws sdk? [\#251](https://github.com/testdouble/testdouble.js/issues/251)
84+
- Cannot use `td.object` with "callable objects" [\#232](https://github.com/testdouble/testdouble.js/issues/232)
85+
86+
**Merged pull requests:**
87+
88+
- Allow stubbing of custom instances & Object.create\(\) [\#264](https://github.com/testdouble/testdouble.js/pull/264) ([searls](https://github.com/searls))
89+
- Enable tsc in ci pipeline take 2 [\#260](https://github.com/testdouble/testdouble.js/pull/260) ([duluca](https://github.com/duluca))
90+
- TypeScript typing thenResolve takes variable args [\#258](https://github.com/testdouble/testdouble.js/pull/258) ([miyu](https://github.com/miyu))
91+
- Test testdouble.js with testdouble.js! [\#255](https://github.com/testdouble/testdouble.js/pull/255) ([searls](https://github.com/searls))
92+
93+
## [v3.0.0](https://github.com/testdouble/testdouble.js/tree/v3.0.0) (2017-06-02)
94+
[Full Changelog](https://github.com/testdouble/testdouble.js/compare/v2.1.2...v3.0.0)
95+
96+
**Fixed bugs:**
97+
98+
- Figure out babel+instanceof+constructor problems with class extension [\#241](https://github.com/testdouble/testdouble.js/issues/241)
99+
- Mocking a Class [\#157](https://github.com/testdouble/testdouble.js/issues/157)
100+
101+
**Closed issues:**
102+
103+
- `td.verify` reporting after resolving promises [\#250](https://github.com/testdouble/testdouble.js/issues/250)
104+
- Replacing dependency with td.replace\(path, replacement\) doesn't work [\#249](https://github.com/testdouble/testdouble.js/issues/249)
105+
- Verify constructor [\#248](https://github.com/testdouble/testdouble.js/issues/248)
106+
- td.replace \(\) breaks the cache in require [\#244](https://github.com/testdouble/testdouble.js/issues/244)
107+
- Faking internal calls [\#243](https://github.com/testdouble/testdouble.js/issues/243)
108+
- ECMAScript 2015 Classes with td.constructor\(\) [\#240](https://github.com/testdouble/testdouble.js/issues/240)
109+
- TypeScript: Better Generic Support for td.object\(\) [\#236](https://github.com/testdouble/testdouble.js/issues/236)
110+
- How to Replace Imported Constructor in Another File [\#235](https://github.com/testdouble/testdouble.js/issues/235)
111+
- Mocha Spec Reporter [\#234](https://github.com/testdouble/testdouble.js/issues/234)
112+
- TypeError: 'x' is not a function [\#233](https://github.com/testdouble/testdouble.js/issues/233)
113+
- Inifinite recursion problem [\#231](https://github.com/testdouble/testdouble.js/issues/231)
114+
- Invoke callback within object [\#230](https://github.com/testdouble/testdouble.js/issues/230)
115+
- Testing Constructor invocations [\#229](https://github.com/testdouble/testdouble.js/issues/229)
116+
- Stubbing chained API objects yields a warning [\#228](https://github.com/testdouble/testdouble.js/issues/228)
117+
118+
**Merged pull requests:**
119+
120+
- Stop extending types when replacing constructors [\#254](https://github.com/testdouble/testdouble.js/pull/254) ([searls](https://github.com/searls))
121+
- Fix \#236; Add another overload and its test [\#237](https://github.com/testdouble/testdouble.js/pull/237) ([sgtoj](https://github.com/sgtoj))
122+
3123
## [v2.1.2](https://github.com/testdouble/testdouble.js/tree/v2.1.2) (2017-03-29)
4124
[Full Changelog](https://github.com/testdouble/testdouble.js/compare/v2.1.1...v2.1.2)
5125

6126
**Closed issues:**
7127

8128
- TypeError when used with node -r flag [\#226](https://github.com/testdouble/testdouble.js/issues/226)
9129
- When replacing a node library calling it from other modules does not work as expected [\#225](https://github.com/testdouble/testdouble.js/issues/225)
10-
- Consider using \_.isObjectLike rather than \_.isPlainObject within td.object [\#224](https://github.com/testdouble/testdouble.js/issues/224)
11130

12131
## [v2.1.1](https://github.com/testdouble/testdouble.js/tree/v2.1.1) (2017-03-28)
13132
[Full Changelog](https://github.com/testdouble/testdouble.js/compare/v2.1.0...v2.1.1)
@@ -182,7 +301,6 @@
182301

183302
**Closed issues:**
184303

185-
- Mocking a Class [\#157](https://github.com/testdouble/testdouble.js/issues/157)
186304
- Matcher for a specific position [\#156](https://github.com/testdouble/testdouble.js/issues/156)
187305

188306
**Merged pull requests:**

README.md

Lines changed: 54 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -70,66 +70,66 @@ numbered for easy reading in the priority-order we anticipate people needing the
7070
Here's a rough outline:
7171

7272
1. [Installation](docs/1-installation.md#installing-testdoublejs)
73-
1. [for Node.js](docs/1-installation.md#for-use-in-nodejs-or-browserify)
74-
2. [for browsers](docs/1-installation.md#for-use-in-browsers)
75-
3. [initial configuration](docs/1-installation.md#configuring-testdoublejs-setting-up-in-your-test-suite)
76-
2. [Purpose of testdouble.js](docs/2-howto-purpose.md#background)
77-
1. [in unit tests](docs/2-howto-purpose.md#test-doubles-and-unit-tests)
78-
2. [in integration tests](docs/2-howto-purpose.md#test-doubles-and-integration-tests)
73+
1. [for Node.js](docs/1-installation.md#for-use-in-nodejs-or-browserify)
74+
2. [for browsers](docs/1-installation.md#for-use-in-browsers)
75+
3. [initial configuration](docs/1-installation.md#configuring-testdoublejs-setting-up-in-your-test-suite)
76+
2. [Purpose of testdouble.js](docs/2-howto-purpose.md#purpose)
77+
1. [in unit tests](docs/2-howto-purpose.md#test-doubles-and-unit-tests)
78+
2. [in integration tests](docs/2-howto-purpose.md#test-doubles-and-integration-tests)
7979
3. [Getting started tutorial](docs/3-getting-started.md#getting-started)
8080
4. [Creating test doubles](docs/4-creating-test-doubles.md#creating-test-doubles)
81-
1. [test double functions with `td.function()`](docs/4-creating-test-doubles.md#tdfunctionname)
82-
2. [test double objects with `td.object()`](docs/4-creating-test-doubles.md#tdobject)
83-
3. [test double constructors with `td.constructor()`](docs/4-creating-test-doubles.md#tdconstructor)
81+
1. [test double functions with `td.function()`](docs/4-creating-test-doubles.md#tdfunctionname)
82+
2. [test double objects with `td.object()`](docs/4-creating-test-doubles.md#tdobject)
83+
3. [test double constructors with `td.constructor()`](docs/4-creating-test-doubles.md#tdconstructor)
8484
5. [Stubbing responses](docs/5-stubbing-results.md#stubbing-behavior)
85-
1. [td.when() API](docs/5-stubbing-results.md#tdwhen)
86-
2. [equality argument matching](docs/5-stubbing-results.md#simple-precise-argument-stubbing)
87-
3. [one-liner stubbings](docs/5-stubbing-results.md#one-liner-stubbings)
88-
4. [stubbing sequential return values](docs/5-stubbing-results.md#stubbing-sequential-return-values)
89-
5. [argument matchers](docs/5-stubbing-results.md#loosening-stubbings-with-argument-matchers)
90-
1. [td.matchers.anything()](docs/5-stubbing-results.md#tdmatchersanything)
91-
2. [td.matchers.isA()](docs/5-stubbing-results.md#tdmatchersisa)
92-
3. [td.matchers.contains()](docs/5-stubbing-results.md#tdmatcherscontains)
93-
1. [matching strings](docs/5-stubbing-results.md#strings)
94-
2. [matching arrays](docs/5-stubbing-results.md#arrays)
95-
3. [matching objects](docs/5-stubbing-results.md#objects)
96-
4. [td.matchers.argThat()](docs/5-stubbing-results.md#tdmatchersargthat)
97-
5. [td.matchers.not()](docs/5-stubbing-results.md#tdmatchersnot)
98-
6. [Stubbing callback APIs](docs/5-stubbing-results.md#stubbing-callback-apis)
99-
7. [Stub exceptions with thenThrow](docs/5-stubbing-results.md#stub-exceptions-with-thenthrow)
100-
8. [Stub promises with thenResolve and thenReject](docs/5-stubbing-results.md#stub-promises-with-thenresolve-and-thenreject)
101-
9. [Stub side effects with thenDo](docs/5-stubbing-results.md#stub-side-effects-with-thendo)
102-
10. [Configuring stubbings](docs/5-stubbing-results.md#configuring-stubbings)
103-
1. [ignoreExtraArgs](docs/5-stubbing-results.md#ignoreextraargs)
104-
2. [times](docs/5-stubbing-results.md#times)
105-
3. [defer](docs/5-stubbing-results.md#defer)
106-
4. [delay](docs/5-stubbing-results.md#delay)
85+
1. [td.when() API](docs/5-stubbing-results.md#tdwhen)
86+
2. [equality argument matching](docs/5-stubbing-results.md#simple-precise-argument-stubbing)
87+
3. [one-liner stubbings](docs/5-stubbing-results.md#one-liner-stubbings)
88+
4. [stubbing sequential return values](docs/5-stubbing-results.md#stubbing-sequential-return-values)
89+
5. [argument matchers](docs/5-stubbing-results.md#loosening-stubbings-with-argument-matchers)
90+
1. [td.matchers.anything()](docs/5-stubbing-results.md#tdmatchersanything)
91+
2. [td.matchers.isA()](docs/5-stubbing-results.md#tdmatchersisa)
92+
3. [td.matchers.contains()](docs/5-stubbing-results.md#tdmatcherscontains)
93+
1. [matching strings](docs/5-stubbing-results.md#strings)
94+
2. [matching arrays](docs/5-stubbing-results.md#arrays)
95+
3. [matching objects](docs/5-stubbing-results.md#objects)
96+
4. [td.matchers.argThat()](docs/5-stubbing-results.md#tdmatchersargthat)
97+
5. [td.matchers.not()](docs/5-stubbing-results.md#tdmatchersnot)
98+
6. [Stubbing callback APIs](docs/5-stubbing-results.md#stubbing-callback-apis)
99+
7. [Stub exceptions with thenThrow](docs/5-stubbing-results.md#stub-exceptions-with-thenthrow)
100+
8. [Stub promises with thenResolve and thenReject](docs/5-stubbing-results.md#stub-promises-with-thenresolve-and-thenreject)
101+
9. [Stub side effects with thenDo](docs/5-stubbing-results.md#stub-side-effects-with-thendo)
102+
10. [Configuring stubbings](docs/5-stubbing-results.md#configuring-stubbings)
103+
1. [ignoreExtraArgs](docs/5-stubbing-results.md#ignoreextraargs)
104+
2. [times](docs/5-stubbing-results.md#times)
105+
3. [defer](docs/5-stubbing-results.md#defer)
106+
4. [delay](docs/5-stubbing-results.md#delay)
107107
6. [Verifying invocations](docs/6-verifying-invocations.md#verifying-interactions)
108-
1. [td.verify() API](docs/6-verifying-invocations.md#tdverify)
109-
2. [equality argument matching](docs/6-verifying-invocations.md#arguments)
110-
3. [argument matchers](docs/6-verifying-invocations.md#relaxing-verifications-with-argument-matchers)
111-
1. [td.matchers.anything()](docs/6-verifying-invocations.md#tdmatchersanything)
112-
2. [td.matchers.isA()](docs/6-verifying-invocations.md#tdmatchersisa)
113-
3. [td.matchers.contains()](docs/6-verifying-invocations.md#tdmatcherscontains)
114-
1. [matching strings](docs/6-verifying-invocations.md#strings)
115-
2. [matching arrays](docs/6-verifying-invocations.md#arrays)
116-
3. [matching objects](docs/6-verifying-invocations.md#objects)
117-
4. [td.matchers.argThat()](docs/6-verifying-invocations.md#tdmatchersargthat)
118-
4. [Argument captors](docs/6-verifying-invocations.md#multi-phase-assertions-with-argument-captors)
119-
5. [Configuring verifications](docs/6-verifying-invocations.md#configuring-verifications)
120-
1. [ignoreExtraArgs](docs/6-verifying-invocations.md#ignoreextraargs)
121-
2. [times](docs/6-verifying-invocations.md#times)
108+
1. [td.verify() API](docs/6-verifying-invocations.md#tdverify)
109+
2. [equality argument matching](docs/6-verifying-invocations.md#arguments)
110+
3. [argument matchers](docs/6-verifying-invocations.md#relaxing-verifications-with-argument-matchers)
111+
1. [td.matchers.anything()](docs/6-verifying-invocations.md#tdmatchersanything)
112+
2. [td.matchers.isA()](docs/6-verifying-invocations.md#tdmatchersisa)
113+
3. [td.matchers.contains()](docs/6-verifying-invocations.md#tdmatcherscontains)
114+
1. [matching strings](docs/6-verifying-invocations.md#strings)
115+
2. [matching arrays](docs/6-verifying-invocations.md#arrays)
116+
3. [matching objects](docs/6-verifying-invocations.md#objects)
117+
4. [td.matchers.argThat()](docs/6-verifying-invocations.md#tdmatchersargthat)
118+
4. [Argument captors](docs/6-verifying-invocations.md#multi-phase-assertions-with-argument-captors)
119+
5. [Configuring verifications](docs/6-verifying-invocations.md#configuring-verifications)
120+
1. [ignoreExtraArgs](docs/6-verifying-invocations.md#ignoreextraargs)
121+
2. [times](docs/6-verifying-invocations.md#times)
122122
7. [Replacing dependencies with test doubles](docs/7-replacing-dependencies.md#replacing-real-dependencies-with-test-doubles)
123-
1. [for Node.js](docs/7-replacing-dependencies.md#nodejs)
124-
2. [for Browser JS](docs/7-replacing-dependencies.md#browser)
125-
3. [td.replace() API](docs/7-replacing-dependencies.md#testdoublereplace-api)
123+
1. [for Node.js](docs/7-replacing-dependencies.md#nodejs)
124+
2. [for Browser JS](docs/7-replacing-dependencies.md#browser)
125+
3. [td.replace() API](docs/7-replacing-dependencies.md#testdoublereplace-api)
126126
8. [Writing custom argument matchers](docs/8-custom-matchers.md#custom-argument-matchers)
127127
9. [Debugging with testdouble.js](docs/9-debugging.md#debugging-with-testdoublejs)
128-
1. [td.explain() API](docs/9-debugging.md#tdexplainsometestdouble)
128+
1. [td.explain() API](docs/9-debugging.md#tdexplainsometestdouble)
129129
10. [Plugins](docs/A-plugins.md#plugins)
130-
1. [testdouble-chai](https://github.com/basecase/testdouble-chai)
131-
2. [testdouble-jasmine](https://github.com/BrianGenisio/testdouble-jasmine)
130+
1. [testdouble-chai](https://github.com/basecase/testdouble-chai)
131+
2. [testdouble-jasmine](https://github.com/BrianGenisio/testdouble-jasmine)
132132
11. [Frequently Asked Questions](docs/B-frequently-asked-questions.md#frequently-asked-questions)
133-
1. [Why doesn't `td.replace()` work with external CommonJS modules?](docs/B-frequently-asked-questions.md#why-doesnt-tdreplace-work-with-external-commonjs-modules)
134-
12. [Configuration](docs/C-configuration.md)
135-
1. [td.config](docs/C-configuration.md#tdconfig)
133+
1. [Why shouldn't I call both td.when and td.verify for a single interaction with a test double?](docs/B-frequently-asked-questions.md#why-shouldnt-i-call-both-tdwhen-and-tdverify-for-a-single-interaction-with-a-test-double)
134+
12. [Configuration](docs/C-configuration.md#configuration)
135+
1. [td.config](docs/C-configuration.md#tdconfig)

0 commit comments

Comments
 (0)