react-native-get-pixel_edit/node_modules/node-abort-controller/__tests__/browser.js
2025-07-09 11:41:52 +09:00

20 lines
565 B
JavaScript

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();
});
});