mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 04:34:23 -06:00
29d6cd8fa0
Co-authored-by: Alexandra Vargas <alexa1866@gmail.com> Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import '@testing-library/jest-dom';
|
|
import { configure } from '@testing-library/react';
|
|
import i18next from 'i18next';
|
|
import failOnConsole from 'jest-fail-on-console';
|
|
import { initReactI18next } from 'react-i18next';
|
|
|
|
import { matchers } from './matchers';
|
|
|
|
if (process.env.CI) {
|
|
failOnConsole({
|
|
shouldFailOnLog: true,
|
|
shouldFailOnDebug: true,
|
|
shouldFailOnInfo: true,
|
|
});
|
|
}
|
|
|
|
expect.extend(matchers);
|
|
|
|
i18next.use(initReactI18next).init({
|
|
resources: {},
|
|
returnEmptyString: false,
|
|
lng: 'en-US', // this should be the locale of the phrases in our source JSX
|
|
});
|
|
|
|
// mock out the worker that detects changes in the dashboard
|
|
// The mock is needed because JSDOM does not support workers and
|
|
// the factory uses import.meta.url so we can't use it in CommonJS modules.
|
|
jest.mock('app/features/dashboard-scene/saving/createDetectChangesWorker.ts');
|
|
|
|
// our tests are heavy in CI due to parallelisation and monaco and kusto
|
|
// so we increase the default timeout to 2secs to avoid flakiness
|
|
configure({ asyncUtilTimeout: 2000 });
|