@@ -59,7 +59,6 @@ function createLinkedPair(options?: {
5959} ) : { pageScript : PageScriptChannel < TestProtocol > , panel : PanelChannel < TestProtocol > , dispose : ( ) => void } {
6060 const { port1, port2 } = new MessageChannel ( )
6161 const pageScript = createPageScriptChannel < TestProtocol > ( {
62- events : { note : { } } ,
6362 name : 'devframes:test' ,
6463 ...noHandshake ,
6564 functions : {
@@ -73,7 +72,6 @@ function createLinkedPair(options?: {
7372 } )
7473 pageScript . addPanelPort ( port1 )
7574 const panel = connectPanelChannel < TestProtocol > ( {
76- events : { notify : { } } ,
7775 name : 'devframes:test' ,
7876 ...noHandshake ,
7977 transport : port2 ,
@@ -118,7 +116,6 @@ describe('in-page channel over bring-your-own ports', () => {
118116 const pageScript = createPageScriptChannel < Protocol > ( {
119117 name : 'test' ,
120118 ...noHandshake ,
121- events : { } ,
122119 functions : {
123120 save : { type : 'action' , jsonSerializable : true , handler : ( ) => { } } ,
124121 reset : { type : 'action' , handler : async ( ) => {
@@ -135,7 +132,6 @@ describe('in-page channel over bring-your-own ports', () => {
135132 name : 'test' ,
136133 ...noHandshake ,
137134 functions : { } ,
138- events : { } ,
139135 transport : port2 ,
140136 callTimeoutMs : 100 ,
141137 } )
@@ -204,14 +200,10 @@ describe('in-page channel over bring-your-own ports', () => {
204200 expect ( panelAction ) . toHaveBeenCalledOnce ( )
205201 } )
206202
207- it ( 'rejects subscriptions to functions even when they return void' , ( { onTestFinished } ) => {
208- const warn = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } )
203+ it ( 'keeps untyped runtime subscriptions isolated from functions' , ( { onTestFinished } ) => {
209204 const { pageScript, dispose } = createLinkedPair ( )
210- onTestFinished ( ( ) => {
211- dispose ( )
212- warn . mockRestore ( )
213- } )
214- expect ( ( ) => pageScript . on ( 'boom' as any , ( ) => { } ) ) . toThrowError ( expect . objectContaining ( { name : 'DF0077' } ) )
205+ onTestFinished ( dispose )
206+ expect ( ( ) => pageScript . on ( 'boom' as any , ( ) => { } ) ) . not . toThrow ( )
215207 } )
216208
217209 it ( 'round-trips calls, arguments, and results' , async ( ) => {
@@ -247,19 +239,10 @@ describe('in-page channel over bring-your-own ports', () => {
247239 }
248240 } )
249241
250- it ( 'reports and rejects listeners for undeclared events' , ( { onTestFinished } ) => {
251- const warn = vi . spyOn ( console , 'warn' ) . mockImplementation ( ( ) => { } )
242+ it ( 'accepts listeners without runtime event declarations' , ( { onTestFinished } ) => {
252243 const { panel, dispose } = createLinkedPair ( )
253- onTestFinished ( ( ) => {
254- dispose ( )
255- warn . mockRestore ( )
256- } )
257-
258- expect ( ( ) => {
259- panel . on ( 'missing' as any , ( ) => { } )
260- } ) . toThrowError ( expect . objectContaining ( { name : 'DF0077' } ) )
261- expect ( warn ) . toHaveBeenCalledOnce ( )
262- expect ( warn ) . toHaveBeenCalledWith ( expect . stringContaining ( '[DF0077]' ) )
244+ onTestFinished ( dispose )
245+ expect ( ( ) => panel . on ( 'missing' as any , ( ) => { } ) ) . not . toThrow ( )
263246 } )
264247
265248 it ( 'enforces jsonSerializable payloads with a coded error' , async ( ) => {
@@ -350,7 +333,6 @@ describe('in-page channel over bring-your-own ports', () => {
350333 const offNotify = panelA . on ( 'notify' , value => received . push ( `a:${ value } ` ) )
351334 // Panel B deliberately has no listener for this event.
352335 const panelB = connectPanelChannel < InPageChannelProtocol > ( {
353- events : { } ,
354336 name : 'devframes:test' ,
355337 ...noHandshake ,
356338 transport : b . port2 ,
0 commit comments