addons/components/__tests__/setupTests.tsblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318// jest-dom adds custom jest matchers for asserting on DOM nodes.
b69ab319// allows you to do things like:
b69ab3110// expect(element).toHaveTextContent(/react/i)
b69ab3111// learn more: https://github.com/testing-library/jest-dom
b69ab3112import '@testing-library/jest-dom';
b69ab3113
b69ab3114// jest doesn't have the stylex compilation step, let's just mock it
b69ab3115jest.mock('@stylexjs/stylex', () => {
b69ab3116 return {
b69ab3117 defineVars(_: unknown) {
b69ab3118 return {};
b69ab3119 },
b69ab3120 createTheme(_: unknown, __: unknown) {
b69ab3121 return {};
b69ab3122 },
b69ab3123 props(..._: Array<unknown>) {
b69ab3124 return {};
b69ab3125 },
b69ab3126 create(o: unknown) {
b69ab3127 return o;
b69ab3128 },
b69ab3129 };
b69ab3130});
b69ab3131
b69ab3132import resizeObserver from 'resize-observer-polyfill';
b69ab3133window.ResizeObserver = resizeObserver;