[remix] Fix zero matching on sub catch-all routes (#9707)

Fixes https://github.com/vercel/remix/issues/20.
This commit is contained in:
Nathan Rajlich
2023-03-23 12:35:46 -07:00
committed by GitHub
parent 40f73e7978
commit 64b15d2409
5 changed files with 23 additions and 8 deletions

View File

@@ -13,11 +13,11 @@ describe('getRegExpFromPath()', () => {
describe.each([
{
path: '/:params+',
path: '/:params*',
urls: [
{
url: '/',
expected: false,
expected: true,
},
{
url: '/foo',
@@ -38,7 +38,7 @@ describe('getRegExpFromPath()', () => {
],
},
{
path: '/projects/:params+',
path: '/projects/:params*',
urls: [
{
url: '/',
@@ -48,12 +48,20 @@ describe('getRegExpFromPath()', () => {
url: '/foo',
expected: false,
},
{
url: '/projects',
expected: true,
},
{
url: '/projects/',
expected: true,
},
{
url: '/projects/foo',
expected: true,
},
{
url: '/projects/another',
url: '/projects/foo/another',
expected: true,
},
],