Files
e-tib.com/tests/sentry-config.test.ts
Marc Mintel 17592063bb
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 23s
Build & Deploy / 🧪 QA (push) Successful in 1m16s
Build & Deploy / 🏗️ Build (push) Successful in 2m31s
Build & Deploy / 🚀 Deploy (push) Successful in 25s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 52s
Build & Deploy / 🔔 Notify (push) Successful in 2s
test: fix SENTRY_DSN validation regex to match errors.infra.mintel.me
2026-07-21 12:09:10 +02:00

21 lines
746 B
TypeScript

import { readFileSync } from 'fs';
import { resolve } from 'path';
import { describe, it, expect } from 'vitest';
import * as dotenv from 'dotenv';
describe('Sentry Configuration', () => {
it('should have a valid SENTRY_DSN in .env', () => {
// Read the .env file as a string
const envPath = resolve(process.cwd(), '.env');
const envContent = readFileSync(envPath, 'utf8');
// Parse it using dotenv
const envConfig = dotenv.parse(envContent);
// Assert that SENTRY_DSN is defined and not empty
expect(envConfig.SENTRY_DSN).toBeDefined();
expect(envConfig.SENTRY_DSN.length).toBeGreaterThan(0);
expect(envConfig.SENTRY_DSN).toMatch(/^https:\/\/.+@(?:glitchtip|errors)\.infra\.mintel\.me\/\d+$/);
});
});