From 45f365c7fad6bf22ded0b7512e91f4e320a7a401 Mon Sep 17 00:00:00 2001 From: AllenFang Date: Sun, 1 Apr 2018 17:02:07 +0800 Subject: [PATCH] fix #54: allow Promise to support Promise.finally --- package-lock.json | 23 ++++++++--------------- package.json | 3 ++- src/index.js | 1 + 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6c35193..20266cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2,15 +2,11 @@ "name": "jest-fetch-mock", "version": "1.5.0", "lockfileVersion": 1, - "requires": true, "dependencies": { "encoding": { "version": "0.1.12", "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", - "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", - "requires": { - "iconv-lite": "0.4.19" - } + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=" }, "iconv-lite": { "version": "0.4.19", @@ -25,20 +21,17 @@ "isomorphic-fetch": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", - "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", - "requires": { - "node-fetch": "1.7.3", - "whatwg-fetch": "2.0.3" - } + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=" }, "node-fetch": { "version": "1.7.3", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", - "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", - "requires": { - "encoding": "0.1.12", - "is-stream": "1.1.0" - } + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==" + }, + "promise-polyfill": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-7.1.1.tgz", + "integrity": "sha512-k1ArwERleWt59+JZuPp5Asd4+Eo3R6g4SDWKl8ozLYZE6K5pZULl1e4hlg112OYVgQcJ6IwBlBHP6JkCDUrayA==" }, "whatwg-fetch": { "version": "2.0.3", diff --git a/package.json b/package.json index 9a1c056..bf3c836 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ }, "homepage": "https://github.com/jefflau/jest-fetch-mock#readme", "dependencies": { - "isomorphic-fetch": "^2.2.1" + "isomorphic-fetch": "^2.2.1", + "promise-polyfill": "^7.1.1" }, "prettier": { "semi": false, diff --git a/src/index.js b/src/index.js index d893158..8321890 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,5 @@ require('isomorphic-fetch') +const Promise = require('promise-polyfill'); const ActualResponse = Response