Migrate tests to Vitest

This commit is contained in:
Mike Cao committed 2026-05-14 22:05:34 -07:00
1 parent cbe4d79b3c
commit c0ea3aefbe
15 files changed
+1393 -1839

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
import { expect, test } from 'vitest';
import { matchesConfiguredPath } from './match-configured-path';
test('matches the exact configured path', () => {
expect(matchesConfiguredPath('/d.js', 'd.js')).toBe(true);
});
test('does not match unrelated asset paths that only share the suffix', () => {
expect(matchesConfiguredPath('/_next/static/chunks/app/dashboard.js', 'd.js')).toBe(false);
});
test('matches paths under the configured base path', () => {
expect(matchesConfiguredPath('/umami/d.js', 'd.js', '/umami')).toBe(true);
});
test('normalizes leading slashes in configured paths', () => {
expect(matchesConfiguredPath('/script.js', '/script.js')).toBe(true);
});