mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Same basic idea as https://github.com/vercel/next.js/pull/78787 This test suite has a lot of timeouts with rspack, which causes it to take a long time to run (though not quite long enough that it breaks the job). In general, large test suites are good to break up, because they benefit from parallelism. --- In addition to breaking this test suite up, I also ported it to the new framework, as the way it was patching `next.config.js` was causing problems, since the old integration tests are not run in isolated directories.
35 lines
953 B
TypeScript
35 lines
953 B
TypeScript
/* eslint-env jest */
|
|
|
|
import {
|
|
testShouldRedirect,
|
|
testLinkShouldRewriteTo,
|
|
} from './shared-tests.util'
|
|
import { nextTestSetup, isNextDev } from 'e2e-utils'
|
|
|
|
// we don't need to exhaustively test this, just do some basic sanity checks
|
|
// for use in combiantion with basePath
|
|
;(isNextDev ? describe : describe.skip)(
|
|
'Trailing slashes in development mode, with basepath, trailingSlash: true',
|
|
() => {
|
|
const { next } = nextTestSetup({
|
|
files: __dirname,
|
|
nextConfig: {
|
|
trailingSlash: true,
|
|
basePath: '/docs',
|
|
},
|
|
})
|
|
|
|
testShouldRedirect(next, [
|
|
['/docs/about', '/docs/about/'],
|
|
['/docs', '/docs/'],
|
|
['/docs/catch-all/hello/world', '/docs/catch-all/hello/world/'],
|
|
['/docs/catch-all/hello.world/', '/docs/catch-all/hello.world'],
|
|
])
|
|
|
|
testLinkShouldRewriteTo(next, [
|
|
['/docs/linker?href=/about', '/docs/about/'],
|
|
['/docs/linker?href=/', '/docs/'],
|
|
])
|
|
}
|
|
)
|