kopia lustrzana https://gitlab.com/rysiekpl/libresilient
fetch plugin test: minor indentation fix
rodzic
5a18502bad
commit
ba129551d4
|
@ -3,7 +3,7 @@ const makeServiceWorkerEnv = require('service-worker-mock');
|
|||
global.fetch = require('node-fetch');
|
||||
jest.mock('node-fetch', () => {
|
||||
const context = {
|
||||
then: jest.fn().mockImplementationOnce(() => {
|
||||
then: jest.fn().mockImplementation(() => {
|
||||
const response = { test: "success" };
|
||||
return Promise.resolve(response);
|
||||
})
|
||||
|
@ -34,6 +34,7 @@ describe("plugin: fetch", () => {
|
|||
require("../../plugins/fetch.js");
|
||||
|
||||
const returnedJSON = await self.LibResilientPlugins[0].fetch('https://resilient.is/test.json');
|
||||
expect(fetch).toHaveBeenCalled();
|
||||
expect(returnedJSON).toEqual({test: "success"})
|
||||
});
|
||||
});
|
||||
|
|
Ładowanie…
Reference in New Issue