All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 19s
Build & Deploy / 🧪 QA (push) Successful in 1m31s
Build & Deploy / 🏗️ Build (push) Successful in 2m34s
Build & Deploy / 🚀 Deploy (push) Successful in 25s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 50s
Build & Deploy / 🔔 Notify (push) Successful in 3s
22 lines
944 B
TypeScript
22 lines
944 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { config } from '../proxy';
|
|
|
|
describe('Proxy Middleware Config Matcher', () => {
|
|
const matcherRegex = new RegExp(`^${config.matcher[0]}`);
|
|
|
|
|
|
it('matches localized page routes for next-intl processing', () => {
|
|
expect(matcherRegex.test('/de')).toBe(true);
|
|
expect(matcherRegex.test('/en/contact')).toBe(true);
|
|
expect(matcherRegex.test('/karriere')).toBe(true);
|
|
});
|
|
|
|
it('excludes static assets with any file extension including uppercase .JPG and subdirectories', () => {
|
|
// These should NOT match the middleware (expect test to be false so middleware is bypassed)
|
|
expect(matcherRegex.test('/assets/photos/DJI_0048.JPG')).toBe(false);
|
|
expect(matcherRegex.test('/assets/videos/web/hero-kabelpflug-poster.jpg')).toBe(false);
|
|
expect(matcherRegex.test('/assets/logo-white.png')).toBe(false);
|
|
expect(matcherRegex.test('/_next/image')).toBe(false);
|
|
});
|
|
});
|