1- import { WorkerSandboxSettings , SandboxSettingsConfig } from '../sandbox'
1+ import { IframeSandboxSettings , IframeSandboxSettingsConfig } from '../sandbox'
22
3- describe ( WorkerSandboxSettings , ( ) => {
3+ describe ( IframeSandboxSettings , ( ) => {
44 const edgeFnResponseBody = `function processSignal() { console.log('hello world') }`
5- const baseSettings : SandboxSettingsConfig = {
6- functionHost : undefined ,
5+ const baseSettings : IframeSandboxSettingsConfig = {
76 processSignal : undefined ,
87 edgeFnDownloadURL : 'http://example.com/download' ,
98 edgeFnFetchClient : jest . fn ( ) . mockReturnValue (
@@ -13,21 +12,21 @@ describe(WorkerSandboxSettings, () => {
1312 ) ,
1413 }
1514 test ( 'initializes with provided settings' , async ( ) => {
16- const sandboxSettings = new WorkerSandboxSettings ( { ...baseSettings } )
15+ const sandboxSettings = new IframeSandboxSettings ( { ...baseSettings } )
1716 expect ( baseSettings . edgeFnFetchClient ) . toHaveBeenCalledWith (
1817 baseSettings . edgeFnDownloadURL
1918 )
2019 expect ( await sandboxSettings . processSignal ) . toEqual ( edgeFnResponseBody )
2120 } )
2221
2322 test ( 'normalizes edgeFnDownloadURL when functionHost is provided' , async ( ) => {
24- const settings : SandboxSettingsConfig = {
23+ const settings = {
2524 ...baseSettings ,
2625 processSignal : undefined ,
2726 functionHost : 'newHost.com' ,
2827 edgeFnDownloadURL : 'https://original.com/download' ,
2928 }
30- new WorkerSandboxSettings ( settings )
29+ new IframeSandboxSettings ( settings )
3130 expect ( baseSettings . edgeFnFetchClient ) . toHaveBeenCalledWith (
3231 'https://newHost.com/download'
3332 )
@@ -37,12 +36,12 @@ describe(WorkerSandboxSettings, () => {
3736 const consoleWarnSpy = jest
3837 . spyOn ( console , 'warn' )
3938 . mockImplementation ( ( ) => { } )
40- const settings : SandboxSettingsConfig = {
39+ const settings = {
4140 ...baseSettings ,
4241 processSignal : undefined ,
4342 edgeFnDownloadURL : undefined ,
4443 }
45- const sandboxSettings = new WorkerSandboxSettings ( settings )
44+ const sandboxSettings = new IframeSandboxSettings ( settings )
4645 expect ( await sandboxSettings . processSignal ) . toEqual (
4746 'globalThis.processSignal = function processSignal() {}'
4847 )
0 commit comments