clever-frontend-utils
Advanced tools
Comparing version
@@ -335,3 +335,3 @@ "use strict"; | ||
} | ||
expect(response).toEqual(testResponse); | ||
expect(response).toEqual(testResponse.clone()); | ||
}); | ||
@@ -373,3 +373,3 @@ Fetch_1.Fetch.on(Fetch_1.Fetch.Event.SUCCESS, mock); | ||
}); }); | ||
it("fires an ERROR event for an unsuccessful request", function () { return __awaiter(void 0, void 0, void 0, function () { | ||
test("fires an ERROR event for an unsuccessful request", function () { return __awaiter(void 0, void 0, void 0, function () { | ||
var cb, err_2; | ||
@@ -376,0 +376,0 @@ return __generator(this, function (_a) { |
@@ -180,4 +180,6 @@ import { Fetch } from "./Fetch"; | ||
}); | ||
describe.each(ALL_METHODS)("events for FetchMethod %s", (method) => { | ||
describe.each(ALL_METHODS)("events for FetchMethod %s", (method: Fetch.Method) => { | ||
jest.useFakeTimers(); | ||
test("events include request and response information", async () => { | ||
@@ -202,4 +204,5 @@ const testBody = { x: 5 }; | ||
} | ||
expect(response).toEqual(testResponse); | ||
expect(response).toEqual(testResponse.clone()); | ||
}); | ||
Fetch.on(Fetch.Event.SUCCESS, mock); | ||
@@ -216,2 +219,3 @@ fetchMock.once("*", testResponse); | ||
}); | ||
test("fires a SUCCESS event for a successful request", async () => { | ||
@@ -225,3 +229,4 @@ const mock = jest.fn(); | ||
}); | ||
it("fires an ERROR event for an unsuccessful request", async () => { | ||
test("fires an ERROR event for an unsuccessful request", async () => { | ||
expect.assertions(1); | ||
@@ -239,2 +244,3 @@ const cb = jest.fn(); | ||
}); | ||
test("allows registering multiple handlers for the same event", async () => { | ||
@@ -265,2 +271,3 @@ jest.useFakeTimers(); | ||
}); | ||
describe("global headers", () => { | ||
@@ -267,0 +274,0 @@ it("applies constant and function global headers", async () => { |
{ | ||
"name": "clever-frontend-utils", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "A set of utils for frontend projects at Clever (and potentially elsewhere!)", | ||
@@ -44,3 +44,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"isomorphic-fetch": "^2.2.1", | ||
"isomorphic-fetch": "^3.0.0", | ||
"lodash": "^4.17.10", | ||
@@ -47,0 +47,0 @@ "reselect": "^3.0.1" |
Sorry, the diff of this file is not supported yet
180675
0.15%+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated