start fixing tests
This commit is contained in:
@ -94,12 +94,13 @@ tap.test('PathMatcher - findAllMatches', async () => {
|
||||
|
||||
const matches = PathMatcher.findAllMatches(patterns, '/api/users/123/profile');
|
||||
|
||||
// All patterns should match (including /api/users as a prefix match)
|
||||
expect(matches).toHaveLength(5);
|
||||
// With the stricter path matching, /api/users won't match /api/users/123/profile
|
||||
// Only patterns with wildcards, parameters, or exact matches will work
|
||||
expect(matches).toHaveLength(4);
|
||||
|
||||
// Verify all expected patterns are in the results
|
||||
const matchedPatterns = matches.map(m => m.pattern);
|
||||
expect(matchedPatterns).toContain('/api/users');
|
||||
expect(matchedPatterns).not.toContain('/api/users'); // This won't match anymore (no prefix matching)
|
||||
expect(matchedPatterns).toContain('/api/users/:id');
|
||||
expect(matchedPatterns).toContain('/api/users/:id/profile');
|
||||
expect(matchedPatterns).toContain('/api/*');
|
||||
|
Reference in New Issue
Block a user