Skip to content

Commit 6d2e37d

Browse files
committed
test(rsc-mf): cover namespace and export-type-all inference edges
1 parent 2b24a63 commit 6d2e37d

3 files changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * as remoteActionsNamespace from './actions';
2+
3+
export const EXPORT_NAMESPACE_ACTION_BRIDGE = 'export-namespace-action-bridge';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export type * from './actions';
2+
3+
export const EXPORT_TYPE_ALL_ACTION_BRIDGE = 'export-type-all-action-bridge';

tests/integration/rsc-mf/tests/createRscExposeDefinitions.test.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,21 @@ describe('createRscExposeDefinitions', () => {
441441
});
442442
});
443443

444+
it('does not infer callback bootstrap from export type * re-export clauses', () => {
445+
const { createRscExposeDefinitions } = loadCreateRscExposeDefinitions();
446+
expect(
447+
createRscExposeDefinitions({
448+
'./customExportTypeAllActionBridge':
449+
'./src/components/exportTypeAllActionBridge.ts',
450+
}),
451+
).toEqual({
452+
'./customExportTypeAllActionBridge': {
453+
import: ['./src/components/exportTypeAllActionBridge.ts'],
454+
layer: 'react-server-components',
455+
},
456+
});
457+
});
458+
444459
it('infers callback bootstrap when import clause includes runtime bindings', () => {
445460
const { createRscExposeDefinitions, CALLBACK_BOOTSTRAP_MODULE } =
446461
loadCreateRscExposeDefinitions();
@@ -460,6 +475,25 @@ describe('createRscExposeDefinitions', () => {
460475
});
461476
});
462477

478+
it('infers callback bootstrap from export namespace runtime bindings', () => {
479+
const { createRscExposeDefinitions, CALLBACK_BOOTSTRAP_MODULE } =
480+
loadCreateRscExposeDefinitions();
481+
expect(
482+
createRscExposeDefinitions({
483+
'./customExportNamespaceActionBridge':
484+
'./src/components/exportNamespaceActionBridge.ts',
485+
}),
486+
).toEqual({
487+
'./customExportNamespaceActionBridge': {
488+
import: [
489+
CALLBACK_BOOTSTRAP_MODULE,
490+
'./src/components/exportNamespaceActionBridge.ts',
491+
],
492+
layer: 'react-server-components',
493+
},
494+
});
495+
});
496+
463497
it('infers callback bootstrap from local side-effect imports of action modules', () => {
464498
const { createRscExposeDefinitions, CALLBACK_BOOTSTRAP_MODULE } =
465499
loadCreateRscExposeDefinitions();

0 commit comments

Comments
 (0)