"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _nodeFetch = _interopRequireDefault(require("node-fetch"));
var _unidriverCore = require("@wix/unidriver-core");
// jest-canvas-mock uses jest.fn() internally; provide compat shim before loading
// @ts-expect-error jest compat shim for jest-canvas-mock
globalThis.jest = vi;
require('jest-canvas-mock');
vi.mock('../deprecationLog');
(0, _unidriverCore.configureUniDriver)({
  defaultTimeout: 2500
});

// @ts-expect-error node-fetch types differ from global fetch
global.fetch = _nodeFetch.default;
// @ts-expect-error node-fetch types differ from global fetch
global.setImmediate = global.setTimeout;
global.ResizeObserver = class {
  observe() {}
  unobserve() {}
  disconnect() {}
};

// Suppress noisy React deprecation warnings in test output
var originConsoleError = console.error;
var suppressedWarnings = ['findDOMNode is deprecated', 'uses the legacy childContextTypes API which is no longer supported', 'uses the legacy contextTypes API which is no longer supported'];
console.error = function () {
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
    args[_key] = arguments[_key];
  }
  var isSuppressed = args.some(arg => typeof arg === 'string' && suppressedWarnings.some(w => arg.includes(w)));
  if (!isSuppressed) {
    originConsoleError.apply(console, args);
  }
};
//# sourceMappingURL=vitest-setup.js.map