Skip to content

Commit 1dba1cf

Browse files
committed
test(rsc-mf): prevent host callback runtime leakage
1 parent f071c8d commit 1dba1cf

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,9 @@ function runTests({ mode }: TestConfig) {
578578
source =>
579579
!source.includes('registerRemoteServerCallback') &&
580580
!source.includes('initServerCallback') &&
581-
!source.includes('registerServerCallback'),
581+
!source.includes('registerServerCallback') &&
582+
!source.includes('setServerCallback') &&
583+
!source.includes('rsc-mf-react-server-dom-client-browser'),
582584
),
583585
).toBe(true);
584586
expect(runtimeInitSource).toContain('registerRemoteServerCallback');
@@ -613,6 +615,7 @@ function runTests({ mode }: TestConfig) {
613615
expect(runtimeRegisterSource).not.toContain(
614616
"from 'react-server-dom-rspack/client.browser'",
615617
);
618+
expect(runtimeRegisterSource).not.toContain('127.0.0.1:');
616619
expect(runtimeRegisterSource).not.toContain('window.location');
617620
expect(runtimeRegisterSource).toContain("remoteAlias = 'rscRemote'");
618621
expect(runtimeRegisterSource).toContain(
@@ -689,6 +692,10 @@ function runTests({ mode }: TestConfig) {
689692
expect(hostModuleFederationConfigSource).toContain(
690693
'./runtime/forceRemotePublicPath.ts',
691694
);
695+
expect(hostModuleFederationConfigSource).toContain(
696+
"process.env.NODE_ENV === 'production'",
697+
);
698+
expect(hostModuleFederationConfigSource).toContain(': []');
692699
expect(hostModuleFederationConfigSource).toContain(
693700
'/static/mf-manifest.json',
694701
);

0 commit comments

Comments
 (0)