Projektstart
This commit is contained in:
19
backend/node_modules/node-abort-controller/__tests__/browser.js
generated
vendored
Normal file
19
backend/node_modules/node-abort-controller/__tests__/browser.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
describe("AbortController in browser", function () {
|
||||
// Mock AbortController
|
||||
const mockedGlobalAbortController = jest.fn();
|
||||
|
||||
beforeAll(() => {
|
||||
// Attach mocked AbortController to global
|
||||
self.AbortController = mockedGlobalAbortController;
|
||||
});
|
||||
|
||||
it("should call global abort controller", function () {
|
||||
// Require module after global setup
|
||||
const { AbortController } = require("../browser.js");
|
||||
|
||||
const controller = new AbortController();
|
||||
|
||||
expect(controller).toBeTruthy();
|
||||
expect(mockedGlobalAbortController).toBeCalled();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user