Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Jul 20, 2020
1 parent 86576ef commit dd49d91
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions packages/next/lib/load-custom-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,8 @@ export default async function loadCustomRoutes(
if (config.trailingSlash) {
redirects.unshift(
{
source: '/:path*/:file.:ext/',
destination: '/:path*/:file.:ext',
source: '/:file((?:[^/]+/)*[^/]+\\.\\w+)/',
destination: '/:file',
permanent: true,
},
{
Expand Down
8 changes: 4 additions & 4 deletions test/integration/trailing-slashes/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,13 @@ describe('Trailing slashes', () => {
expect.objectContaining({
redirects: expect.arrayContaining([
expect.objectContaining({
source: '/:path*/:file.:ext/',
destination: '/:path*/:file.:ext',
source: '/:file((?:[^/]+/)*[^/]+\\.\\w+)/',
destination: '/:file',
statusCode: 308,
}),
expect.objectContaining({
source: '/:path*/:notfile([^/.]+)',
destination: '/:path*/:notfile/',
source: '/:notfile((?:[^/]+/)*[^/\\.]+)',
destination: '/:notfile/',
statusCode: 308,
}),
]),
Expand Down

0 comments on commit dd49d91

Please sign in to comment.