fetch-mock
Advanced tools
Comparing version 4.3.1 to 4.4.0
@@ -199,2 +199,5 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.fetchMock = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
this.fetchMock = this.fetchMock.bind(this); | ||
this.restore = this.restore.bind(this); | ||
this.reMock = this.reMock.bind(this); | ||
this.reset = this.reset.bind(this); | ||
this.realFetch = theGlobal.fetch && theGlobal.fetch.bind(theGlobal); | ||
@@ -201,0 +204,0 @@ } |
@@ -184,2 +184,5 @@ 'use strict'; | ||
this.fetchMock = this.fetchMock.bind(this); | ||
this.restore = this.restore.bind(this); | ||
this.reMock = this.reMock.bind(this); | ||
this.reset = this.reset.bind(this); | ||
this.realFetch = theGlobal.fetch && theGlobal.fetch.bind(theGlobal); | ||
@@ -186,0 +189,0 @@ } |
{ | ||
"name": "fetch-mock", | ||
"version": "4.3.1", | ||
"version": "4.4.0", | ||
"description": "Mock http requests made using fetch (or isomorphic-fetch)", | ||
@@ -5,0 +5,0 @@ "main": "src/server.js", |
@@ -42,2 +42,4 @@ # fetch-mock [![Build Status](https://travis-ci.org/wheresrhys/fetch-mock.svg?branch=master)](https://travis-ci.org/wheresrhys/fetch-mock) | ||
*Note that `restore()`, `reMock()` and `reset()` are all bound to fetchMock, and can be used directly as callbacks e.g. `afterEach(fetchMock.restore)` will work just fine. There is no need for `afterEach(function () {fetchMock.restore()})`* | ||
**For the methods below `matcher`, if given, should be either the name of a route (see advanced usage below) or equal to `matcher.toString()` for any unnamed route** | ||
@@ -76,4 +78,4 @@ | ||
expect(JSON.parse(fetchMock.lastOptions('http://domain2').body)).to.deep.equal({prop: 'val'}); | ||
fetchMock.restore(); | ||
}) | ||
.then(fetchMock.restore) | ||
``` | ||
@@ -80,0 +82,0 @@ |
@@ -167,2 +167,5 @@ 'use strict'; | ||
this.fetchMock = this.fetchMock.bind(this); | ||
this.restore = this.restore.bind(this); | ||
this.reMock = this.reMock.bind(this); | ||
this.reset = this.reset.bind(this); | ||
this.realFetch = theGlobal.fetch && theGlobal.fetch.bind(theGlobal); | ||
@@ -169,0 +172,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
81662
2211
169