mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
try to commit
This commit is contained in:
@@ -6,8 +6,8 @@ process.env.DB_PORT = '5432';
|
||||
process.env.S3_ENDPOINT = 'http://test-s3:3900';
|
||||
process.env.S3_PUBLIC_URL = 'https://cdn.example.com';
|
||||
process.env.S3_BUCKET = 'test-bucket';
|
||||
process.env.SMTP_HOST = 'smtp.test.com';
|
||||
process.env.SMTP_PORT = '587';
|
||||
process.env.GOOGLE_CLIENT_ID = 'test-client-id';
|
||||
process.env.GMAIL_REFRESH_TOKEN = 'test-refresh-token';
|
||||
process.env.REDIS_URL = 'redis://127.0.0.1:6379';
|
||||
|
||||
// ── Mock all infrastructure before the service module loads ───────────────────
|
||||
@@ -19,7 +19,7 @@ jest.mock('../../services/email.service', () => ({ ping: jest.fn() }));
|
||||
const db = require('../../config/db.config');
|
||||
const cache = require('../../config/redis.config');
|
||||
const { ping: s3 } = require('../../services/s3.service');
|
||||
const { ping: smtp } = require('../../services/email.service');
|
||||
const { ping: smtp } = require('../../services/email.service'); // alias kept for test-body brevity; JSON key is now "email"
|
||||
const { runDashboard, runReadiness } = require('../../services/health.service');
|
||||
|
||||
// ── Reset mocks between tests ─────────────────────────────────────────────────
|
||||
@@ -184,10 +184,10 @@ describe('runReadiness()', () => {
|
||||
expect(body).toHaveProperty('memory');
|
||||
});
|
||||
|
||||
test('checks object has database, cache, storage, smtp keys', async () => {
|
||||
test('checks object has database, cache, storage, email keys', async () => {
|
||||
allHealthy();
|
||||
const { body } = await runReadiness();
|
||||
['database', 'cache', 'storage', 'smtp'].forEach((key) => {
|
||||
['database', 'cache', 'storage', 'email'].forEach((key) => {
|
||||
expect(body.checks).toHaveProperty(key);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user