diff --git a/packages/router-plugin/tests/code-splitter-module-state.test.ts b/packages/router-plugin/tests/code-splitter-module-state.test.ts index 36ce98681f..a62848ebca 100644 --- a/packages/router-plugin/tests/code-splitter-module-state.test.ts +++ b/packages/router-plugin/tests/code-splitter-module-state.test.ts @@ -1007,7 +1007,9 @@ export const Route = createFileRoute('/')({ // option reads the same instance, and what only one split option imports // does not load with the route module. describe('state only split options read, in a .jsx route file', () => { - const stateRoute = (options: string) => `${head}import { init, see } from './init' + const stateRoute = ( + options: string, + ) => `${head}import { init, see } from './init' const store = init({ label: 'shared' }) export const Route = createFileRoute('/')({ ${options} diff --git a/packages/router-plugin/tests/code-splitter-plugin-pipeline.test.ts b/packages/router-plugin/tests/code-splitter-plugin-pipeline.test.ts index dda9077676..1488c74021 100644 --- a/packages/router-plugin/tests/code-splitter-plugin-pipeline.test.ts +++ b/packages/router-plugin/tests/code-splitter-plugin-pipeline.test.ts @@ -451,8 +451,9 @@ export const doubled = [1, 2].map(function double(value) { const destructuring = await server.import('/src/destructuring.ts') const lazy = await server.import('/routes/posts.lazy.tsx') const preview = await server.import('/src/route-preview.tsx') - const { widgets, Route: widgetsRoute } = - await server.import('/routes/widgets.tsx') + const { widgets, Route: widgetsRoute } = await server.import( + '/routes/widgets.tsx', + ) // The router plugin left each module as it was (the router transform // boundary, before Vite's own transforms). for (const file of unowned.filter( @@ -512,11 +513,7 @@ export const doubled = [1, 2].map(function double(value) { items: [['item'], false, false], lazy: false, preview: ['preview data', false], - widgets: [ - '/foreign-widget', - 'foreign data', - true, - ], + widgets: ['/foreign-widget', 'foreign data', true], }) expect([ await renderRouteComponent(code.itemsRoute.options.component), @@ -539,9 +536,9 @@ export const doubled = [1, 2].map(function double(value) { ]) // The route the registered file creates is the one it splits (the // genuine call bound to `Route`; SPEC J2.1). - expect( - 'preload' in widgetsRoute.options.component, - ).toBe(autoCodeSplitting) + expect('preload' in widgetsRoute.options.component).toBe( + autoCodeSplitting, + ) }, ) }) @@ -705,9 +702,7 @@ export const Route = createFileRoute('/hmr')({ { framework: target, importMeta }, ) expect( - html( - await renderComponent((Route as any).options.component, {}, target), - ), + html(await renderComponent((Route as any).options.component, {}, target)), ).toBe('
hmr
') } diff --git a/packages/router-plugin/tests/code-splitter-route-options.test.ts b/packages/router-plugin/tests/code-splitter-route-options.test.ts index 10e5146a5e..230523545d 100644 --- a/packages/router-plugin/tests/code-splitter-route-options.test.ts +++ b/packages/router-plugin/tests/code-splitter-route-options.test.ts @@ -585,7 +585,10 @@ ${groupings} loader: () => 'data', try { captured = await captureConsole(() => loadRoute(code)) } catch (error) { - expectDiagnostic(error, { severity: 'error', names: ['codeSplitGroupings'] }) + expectDiagnostic(error, { + severity: 'error', + names: ['codeSplitGroupings'], + }) return } const { result: loaded, diagnostics } = captured diff --git a/packages/router-plugin/tests/integration/known-bugs-code-splitter-property-write.test.ts b/packages/router-plugin/tests/integration/known-bugs-code-splitter-property-write.test.ts index 5c35a47857..9724ffa886 100644 --- a/packages/router-plugin/tests/integration/known-bugs-code-splitter-property-write.test.ts +++ b/packages/router-plugin/tests/integration/known-bugs-code-splitter-property-write.test.ts @@ -59,37 +59,35 @@ export async function mount(path: string) { // well is no fix: the page code then loads with the entry chunk. // Source: the #8504 probe (memos/splitter.md B6). // Impact: the app's entry throws when it loads ("Page is not defined"). -describe.concurrent.each([ - 'vite', - 'rspack', - 'webpack', - 'rsbuild', -] as const)('%s', (bundler) => { - it.for([ - { hint: 'without a sideEffects field', sideEffects: undefined }, - { hint: 'with "sideEffects": false', sideEffects: false }, - ])( - 'a component the route file writes a property of loads with its chunk and renders the property ($hint)', - { timeout, fails: true }, - async ({ sideEffects }, { expect, onTestFinished }: TestContext) => { - const options = { - sideEffects, - files, - registerCleanup: onTestFinished, - } - const built = - bundler === 'rsbuild' - ? await buildWithRsbuild(options) - : await build({ - bundler: bundler satisfies Bundler, - env: 'client', - ...options, - }) - const { html } = await built.run(`await entry.mount('/display-name')`) - expect({ placement: built.where(marker), html }).toEqual({ - placement: 'lazy', - html: `second version true
', - ) + expect(await read(again, separateGroups)).toBe('second version true
') }) // Two router plugins in one dev server (each with its own routes