fetch-mock
Advanced tools
Comparing version 5.3.0 to 5.3.1
{ | ||
"name": "fetch-mock", | ||
"version": "5.3.0", | ||
"version": "5.3.1", | ||
"description": "Mock http requests made using fetch (or isomorphic-fetch)", | ||
@@ -5,0 +5,0 @@ "main": "src/server.js", |
@@ -168,22 +168,2 @@ # fetch-mock [![Build Status](https://travis-ci.org/wheresrhys/fetch-mock.svg?branch=master)](https://travis-ci.org/wheresrhys/fetch-mock) | ||
##### Example | ||
```js | ||
fetchMock | ||
.mock('http://domain1', 200) | ||
.mock('http://domain2', 'PUT', { | ||
affectedRecords: 1 | ||
}); | ||
myModule.onlyCallDomain2() | ||
.then(() => { | ||
expect(fetchMock.called('http://domain2')).to.be.true; | ||
expect(fetchMock.called('http://domain1')).to.be.false; | ||
expect(fetchMock.calls().unmatched.length).to.equal(0); | ||
expect(JSON.parse(fetchMock.lastUrl('http://domain2'))).to.equal('http://domain2/endpoint'); | ||
expect(JSON.parse(fetchMock.lastOptions('http://domain2').body)).to.deep.equal({prop: 'val'}); | ||
}) | ||
.then(fetchMock.restore) | ||
``` | ||
## Troubleshooting and alternative installation | ||
@@ -190,0 +170,0 @@ |
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
67484
214