Files
opencommit-gitea/test/jest-setup.ts
T
Tiger Kaovilai 6bc1d90469 npm run test:unit passing locally
Signed-off-by: Tiger Kaovilai <passawit.kaovilai@gmail.com>
2025-04-14 05:06:45 -04:00

19 lines
619 B
TypeScript

// Using Node.js module interop for ESM/CommonJS compatibility
import { createRequire } from 'module';
// Create a require function scoped to this module
const moduleRequire = createRequire(import.meta.url);
// Use the scoped require to import CommonJS modules
moduleRequire('cli-testing-library/extend-expect');
import { configure } from 'cli-testing-library';
import { jest } from '@jest/globals';
// Make Jest available globally
global.jest = jest;
/**
* Adjusted the wait time for waitFor/findByText to 2000ms, because the default 1000ms makes the test results flaky
*/
configure({ asyncUtilTimeout: 2000 });