mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2025-12-10 05:26:44 +03:00
fix: add config-encryption mocks to test files for CI compatibility
- Add config-encryption module mocks to gitea-enhanced.test.ts - Add config-encryption module mocks to gitea-starred-repos.test.ts - Update helpers mock in setup.bun.ts to include createEvent function The CI environment was loading modules in a different order than local, causing the config-encryption module to be accessed before it was mocked in the global setup. Adding the mocks directly to the test files ensures they are available regardless of module loading order.
This commit is contained in:
@@ -25,6 +25,14 @@ mock.module("@/lib/db", () => ({
|
||||
repositories: {}
|
||||
}));
|
||||
|
||||
// Mock config encryption
|
||||
mock.module("@/lib/utils/config-encryption", () => ({
|
||||
decryptConfigTokens: (config: any) => config,
|
||||
encryptConfigTokens: (config: any) => config,
|
||||
getDecryptedGitHubToken: (config: any) => config.githubConfig?.token || "",
|
||||
getDecryptedGiteaToken: (config: any) => config.giteaConfig?.token || ""
|
||||
}));
|
||||
|
||||
// Now import the modules we're testing
|
||||
import {
|
||||
getGiteaRepoInfo,
|
||||
|
||||
Reference in New Issue
Block a user