fix: correct environment variable name for Redis password in deployment workflow
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 3m45s
All checks were successful
Deploy to Web Server flyer-crawler.projectium.com / deploy (push) Successful in 3m45s
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
// src/index.test.tsx
|
||||
import React from 'react';
|
||||
import { describe, it, vi, afterEach, beforeEach } from 'vitest';
|
||||
|
||||
// Mock the App component to isolate the test to index.tsx's mounting logic
|
||||
vi.mock('./App', () => ({
|
||||
default: () => <div data-testid="app-mock">Mocked App</div>,
|
||||
}));
|
||||
|
||||
// Mock pdfjs-dist to prevent errors during App.tsx import.
|
||||
// It must mock all properties accessed by App.tsx at the top level, like `GlobalWorkerOptions`.
|
||||
vi.mock('pdfjs-dist', () => ({
|
||||
GlobalWorkerOptions: { workerSrc: '' },
|
||||
getDocument: vi.fn().mockReturnValue({ promise: Promise.resolve({ getPage: vi.fn() }) }),
|
||||
}));
|
||||
|
||||
describe('index.tsx', () => {
|
||||
let root: HTMLElement;
|
||||
|
||||
beforeEach(() => {
|
||||
// Reset modules before each test to ensure index.tsx's side-effects run.
|
||||
vi.resetModules();
|
||||
|
||||
// Create a root element for the app to mount to
|
||||
root = document.createElement('div');
|
||||
root.id = 'root';
|
||||
document.body.appendChild(root);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
// Clean up the root element after each test
|
||||
document.body.removeChild(root);
|
||||
});
|
||||
|
||||
it.todo('should render the App component into the root element', () => {
|
||||
// This test was causing an infinite loop and massive memory consumption in CI.
|
||||
// The pattern of using `vi.resetModules()` and then dynamically importing
|
||||
// the main entry point (`index.tsx`) is unstable.
|
||||
// The functionality of mounting the app is implicitly tested by all other component tests.
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user