diff --git a/packages/router-plugin/tests/integration/dev-server-generator-watching.test.ts b/packages/router-plugin/tests/integration/dev-server-generator-watching.test.ts index 2dd74bb765..06129afa02 100644 --- a/packages/router-plugin/tests/integration/dev-server-generator-watching.test.ts +++ b/packages/router-plugin/tests/integration/dev-server-generator-watching.test.ts @@ -30,13 +30,9 @@ describeGeneratorWatching('vite') // virtualRouteConfig file updates the route tree". // Impact: in Vite dev, a route added to (or changed in) the virtual route // config is missing from the app until the dev server restarts. -test.fails( - 'an edit of the virtual route config file changes the live routes', - async () => { - await expectVirtualRouteConfigEdit('vite') - }, - 45_000, -) +test('an edit of the virtual route config file changes the live routes', async () => { + await expectVirtualRouteConfigEdit('vite') +}, 45_000) // Bug: an edit of a `__virtual.ts` subtree config never reaches the live // routes: the route tree keeps the subtree the dev server started with. @@ -47,10 +43,6 @@ test.fails( // src/filesystem/physical/getRouteNodes.ts for `__virtual.ts` files. // Impact: in Vite dev, a route added to a `__virtual.ts` file is missing // from the app until the dev server restarts. -test.fails( - 'an edit of a __virtual.ts file changes the live routes', - async () => { - await expectVirtualSubtreeEdit('vite') - }, - 45_000, -) +test('an edit of a __virtual.ts file changes the live routes', async () => { + await expectVirtualSubtreeEdit('vite') +}, 45_000) diff --git a/packages/router-plugin/tests/integration/known-bugs-rsbuild-generator-physical.test.ts b/packages/router-plugin/tests/integration/known-bugs-rsbuild-generator-physical.test.ts index 94af85d476..d528ace561 100644 --- a/packages/router-plugin/tests/integration/known-bugs-rsbuild-generator-physical.test.ts +++ b/packages/router-plugin/tests/integration/known-bugs-rsbuild-generator-physical.test.ts @@ -33,10 +33,6 @@ const settleTimeout = 6_000 // directory a virtual route config mounts with `physical()` is missing from // the app until another route file is created in the routes directory or the // dev server restarts. -test.fails( - 'a route file created under a physical() mount outside the routes directory reaches the live routes', - async () => { - await expectPhysicalMountRouteFile('rsbuild', settleTimeout) - }, - 30_000, -) +test('a route file created under a physical() mount outside the routes directory reaches the live routes', async () => { + await expectPhysicalMountRouteFile('rsbuild', settleTimeout) +}, 30_000) diff --git a/packages/router-plugin/tests/integration/known-bugs-rsbuild-generator.test.ts b/packages/router-plugin/tests/integration/known-bugs-rsbuild-generator.test.ts index 2c17d9294c..f9350f93f8 100644 --- a/packages/router-plugin/tests/integration/known-bugs-rsbuild-generator.test.ts +++ b/packages/router-plugin/tests/integration/known-bugs-rsbuild-generator.test.ts @@ -36,14 +36,10 @@ const settleTimeout = 6_000 // the same path) stays out of the route tree, keeping the path it was // written with, until another route file is created or the dev server // restarts. -test.fails( - 'a created route file the generator cannot parse is reported, and fixing it adds the route', - async () => { - await expectCreatedBrokenRouteFileFixed( - 'rsbuild', - createdBrokenRouteFiles[0]!.initial, - settleTimeout, - ) - }, - 30_000, -) +test('a created route file the generator cannot parse is reported, and fixing it adds the route', async () => { + await expectCreatedBrokenRouteFileFixed( + 'rsbuild', + createdBrokenRouteFiles[0]!.initial, + settleTimeout, + ) +}, 30_000) diff --git a/packages/router-plugin/tests/integration/rsbuild-dev-server-generator-watching.test.ts b/packages/router-plugin/tests/integration/rsbuild-dev-server-generator-watching.test.ts index cf4a7b950f..a1b20a19a1 100644 --- a/packages/router-plugin/tests/integration/rsbuild-dev-server-generator-watching.test.ts +++ b/packages/router-plugin/tests/integration/rsbuild-dev-server-generator-watching.test.ts @@ -32,13 +32,9 @@ describeGeneratorWatching('rsbuild') // loadConfigFile.ts. // Impact: in Rsbuild/Rspack dev, a route added to the virtual route config // is missing from the app until the dev server restarts. -test.fails( - 'an edit of the virtual route config file changes the live routes', - async () => { - await expectVirtualRouteConfigEdit('rsbuild') - }, - 45_000, -) +test('an edit of the virtual route config file changes the live routes', async () => { + await expectVirtualRouteConfigEdit('rsbuild') +}, 45_000) // Bug: an edit of a `__virtual.ts` subtree config never reaches the live // routes: the file is in no bundle and the generator's own watcher reports @@ -49,10 +45,6 @@ test.fails( // loadConfigFile.ts (not probed in the product). // Impact: in Rsbuild/Rspack dev, a route added to a `__virtual.ts` file is // missing from the app until the dev server restarts. -test.fails( - 'an edit of a __virtual.ts file changes the live routes', - async () => { - await expectVirtualSubtreeEdit('rsbuild') - }, - 45_000, -) +test('an edit of a __virtual.ts file changes the live routes', async () => { + await expectVirtualSubtreeEdit('rsbuild') +}, 45_000) diff --git a/packages/start-plugin-core/tests/integration/known-bugs-route-options.test.ts b/packages/start-plugin-core/tests/integration/known-bugs-route-options.test.ts index 6ce4fead59..14a3e2a368 100644 --- a/packages/start-plugin-core/tests/integration/known-bugs-route-options.test.ts +++ b/packages/start-plugin-core/tests/integration/known-bugs-route-options.test.ts @@ -130,12 +130,9 @@ export const Route = createFileRoute('/cast-${slug(name)}')(${wrap( // `pruneServerOnlySubtrees`; Rsbuild parity is the intended behaviour. // Impact: Rsbuild client bundles ship the route tree entries and route // modules of server-only routes, which Vite builds leave out. - ;(bundler === 'vite' ? test : test.fails)( - 'a route with only server handlers is not in the client route tree', - () => { - expect(clientRoutes).not.toContain('/api') - }, - ) + test('a route with only server handlers is not in the client route tree', () => { + expect(clientRoutes).not.toContain('/api') + }) // Option keys written as strings and a Route exported under an alias are // read like the plain ones above (same build; moved from router-generator @@ -153,12 +150,9 @@ export const Route = createFileRoute('/cast-${slug(name)}')(${wrap( }) // Rsbuild does not prune the client route tree yet (pinned above). - ;(bundler === 'vite' ? test : test.fails)( - 'a route with only server handlers is not in the client route tree', - () => { - expect(clientRoutes).not.toContain(api) - }, - ) + test('a route with only server handlers is not in the client route tree', () => { + expect(clientRoutes).not.toContain(api) + }) }) // Bug: the route generator records only plain, non-computed, non-method @@ -174,12 +168,9 @@ export const Route = createFileRoute('/cast-${slug(name)}')(${wrap( describe.each(pageOptions)('$name', ({ name }) => { // Rsbuild does not prune the client route tree yet (pinned above), so // the route stays. - ;(bundler === 'vite' ? test.fails : test)( - 'a route with server handlers and these options is in the client route tree', - () => { - expect(clientRoutes).toContain(`/${slug(name)}`) - }, - ) + test('a route with server handlers and these options is in the client route tree', () => { + expect(clientRoutes).toContain(`/${slug(name)}`) + }) }) // Bug: route options wrapped in a cast (`as never`, `as any`, @@ -191,12 +182,9 @@ export const Route = createFileRoute('/cast-${slug(name)}')(${wrap( // to the client bundle. // Real apps wrap route options in `as never` / `as any`. describe.each(casts)('options wrapped in $name', ({ name }) => { - test.fails( - 'the server handler code of the route is not in the client bundle', - () => { - const marker = `MARK_CAST_${slug(name).toUpperCase().replace(/-/g, '_')}` - expect(build.client.where(marker)).toBe('nowhere') - }, - ) + test('the server handler code of the route is not in the client bundle', () => { + const marker = `MARK_CAST_${slug(name).toUpperCase().replace(/-/g, '_')}` + expect(build.client.where(marker)).toBe('nowhere') + }) }) }) diff --git a/packages/start-plugin-core/tests/integration/start-build-manifest.test.ts b/packages/start-plugin-core/tests/integration/start-build-manifest.test.ts index 6ed5b0c37a..ee00ab12c8 100644 --- a/packages/start-plugin-core/tests/integration/start-build-manifest.test.ts +++ b/packages/start-plugin-core/tests/integration/start-build-manifest.test.ts @@ -74,20 +74,17 @@ describe.each(startBundlers)('%s build', (bundler) => { // Rsbuild: same bug as known-bugs-route-options.test.ts "a route with only // server handlers is not in the client route tree" (only the Vite plugin // prunes). - ;(bundler === 'vite' ? test : test.fails)( - 'the client route tree is the SSR route tree without the server-only subtree', - async () => { - const ssr = (await build.ssr.run(routeTree)).result as { - paths: Array - } - expect(ssr.paths).toEqual(expect.arrayContaining(['/api', '/inner'])) - // (the harness's probe route, which serves the requests SSR scripts - // run in, is a server-only route too) - const serverOnly = ['/api', '/inner', probeRoutePath] - expect((await build.client.run(routeTree)).result).toEqual({ - rootIsRoot: true, - paths: ssr.paths.filter((path) => !serverOnly.includes(path)), - }) - }, - ) + test('the client route tree is the SSR route tree without the server-only subtree', async () => { + const ssr = (await build.ssr.run(routeTree)).result as { + paths: Array + } + expect(ssr.paths).toEqual(expect.arrayContaining(['/api', '/inner'])) + // (the harness's probe route, which serves the requests SSR scripts + // run in, is a server-only route too) + const serverOnly = ['/api', '/inner', probeRoutePath] + expect((await build.client.run(routeTree)).result).toEqual({ + rootIsRoot: true, + paths: ssr.paths.filter((path) => !serverOnly.includes(path)), + }) + }) }) diff --git a/packages/start-plugin-core/tests/integration/start-compose-project-path.test.ts b/packages/start-plugin-core/tests/integration/start-compose-project-path.test.ts index f595276824..6b7a5dffc2 100644 --- a/packages/start-plugin-core/tests/integration/start-compose-project-path.test.ts +++ b/packages/start-plugin-core/tests/integration/start-compose-project-path.test.ts @@ -77,12 +77,9 @@ return { ids, page: await entry.renderPath(entry.getRouter().routeTree, '/') }`, // "a route with only server handlers is not in the client route tree"). // Impact: the client bundle ships the server-only routes' entries and // modules; a page can navigate to a route that has no page. - test.fails( - 'the client route tree leaves out the server-only route', - async () => { - expect((await build.client.run(clientRouteIds)).result).toEqual(['/']) - }, - ) + test('the client route tree leaves out the server-only route', async () => { + expect((await build.client.run(clientRouteIds)).result).toEqual(['/']) + }) }) describe('of an app with a file named one character away from the generated route tree', () => { @@ -116,16 +113,13 @@ export { sibling } from './routeTree-gen' // client route tree instead of its own code. // Impact: the build fails (the file's exports are gone) or the app // reads the wrong module. - ;(bundler === 'vite' ? test.fails : test)( - 'the client gets the file, not the client route tree', - async () => { - if (!build) { - throw failure - } - expect((await build.client.run(`return entry.sibling`)).result).toBe( - 'MARK_SIBLING', - ) - }, - ) + test('the client gets the file, not the client route tree', async () => { + if (!build) { + throw failure + } + expect((await build.client.run(`return entry.sibling`)).result).toBe( + 'MARK_SIBLING', + ) + }) }) }) diff --git a/packages/start-plugin-core/tests/integration/start-compose-server-only-routes.test.ts b/packages/start-plugin-core/tests/integration/start-compose-server-only-routes.test.ts index 82cc87b0ff..ffab63ed61 100644 --- a/packages/start-plugin-core/tests/integration/start-compose-server-only-routes.test.ts +++ b/packages/start-plugin-core/tests/integration/start-compose-server-only-routes.test.ts @@ -189,23 +189,17 @@ describe.each(startBundlers)('%s build, served', (bundler) => { // Rsbuild: same bug as known-bugs-route-options.test.ts "a route with // only server handlers is not in the client route tree" (only Start's // Vite plugin prunes the client route tree). - ;(bundler === 'vite' ? test : test.fails)( - 'the client route tree leaves out the server-only subtree', - () => { - expect(clientRoutes.filter((id) => id.startsWith('/api'))).toEqual([]) - }, - ) + test('the client route tree leaves out the server-only subtree', () => { + expect(clientRoutes.filter((id) => id.startsWith('/api'))).toEqual([]) + }) // Vite: same bug as known-bugs-route-options.test.ts "a route with server // handlers and these options is in the client route tree: a spread" (the // route generator misses the spread component, so Start takes the route // for server-only and prunes it; Rsbuild prunes nothing). - ;(bundler === 'vite' ? test.fails : test)( - 'the client route tree keeps the page whose component is spread in', - () => { - expect(clientRoutes).toContain('/spread') - }, - ) + test('the client route tree keeps the page whose component is spread in', () => { + expect(clientRoutes).toContain('/spread') + }) test( 'client-side navigation reaches the page under the server-only ancestor', @@ -228,7 +222,7 @@ describe.each(startBundlers)('%s build, served', (bundler) => { // Rsbuild: the server-only route is in the client route tree (pinned // above), so the navigation finds a route without a page. - ;(bundler === 'vite' ? test : test.fails)( + test( 'client-side navigation to a server-only route finds nothing', async () => { const page = await openAppPage(served, '/', { @@ -245,7 +239,7 @@ describe.each(startBundlers)('%s build, served', (bundler) => { ) // Vite: the spread route is pruned (pinned above). - ;(bundler === 'vite' ? test.fails : test)( + test( 'client-side navigation reaches the page whose component is spread in', async () => { const page = await openAppPage(served, '/', {