Refactor CI/CD workflows and configuration files
- Removed unused network configurations from docker-compose.yml. - Added production-specific Jest configuration in jest.config.production.ts for better test management. - Updated jest.config.ts to include production build fixes and module resolution improvements. - Enhanced jest.setup.ts to mock React's act function for production builds. - Introduced new CI/CD workflows for Gitea, focusing on reliability and zero downtime deployments. - Added scripts for debugging Gitea Actions and verifying environment variables. These changes streamline the CI/CD process and improve testing capabilities.
This commit is contained in:
@@ -3,6 +3,24 @@ import React from "react";
|
||||
import { render } from '@testing-library/react';
|
||||
import { ToastProvider } from '@/components/Toast';
|
||||
|
||||
// Fix for React production builds in testing
|
||||
// Mock React's act function for production builds
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
// Override React.act for production builds
|
||||
const originalAct = React.act;
|
||||
if (!originalAct) {
|
||||
React.act = (callback: () => void) => {
|
||||
callback();
|
||||
};
|
||||
}
|
||||
|
||||
// Also mock the act function from react-dom/test-utils
|
||||
const { act } = require('react-dom/test-utils');
|
||||
if (act) {
|
||||
global.act = act;
|
||||
}
|
||||
}
|
||||
|
||||
// Mock react-responsive-masonry
|
||||
jest.mock("react-responsive-masonry", () => ({
|
||||
__esModule: true,
|
||||
|
||||
Reference in New Issue
Block a user