use-async-effekt-hooks
Version:
React hooks for async effects and memoization with proper dependency tracking and linting support
29 lines (28 loc) • 1.03 kB
JavaScript
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
import "@testing-library/jest-dom";
// Mock console.error to avoid noise in tests unless explicitly testing error cases
var originalError = console.error;
beforeAll(function () {
console.error = function () {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (typeof args[0] === "string" &&
args[0].includes("Warning: ReactDOM.render is deprecated")) {
return;
}
originalError.call.apply(originalError, __spreadArray([console], args, false));
};
});
afterAll(function () {
console.error = originalError;
});