@@ -1616,10 +1616,14 @@ describe("importExport", () => {
16161616 expect ( mockContextProxy . export ) . toHaveBeenCalled ( )
16171617 expect ( fs . mkdir ) . toHaveBeenCalledWith ( "/mock/path" , { recursive : true } )
16181618
1619- expect ( safeWriteJson ) . toHaveBeenCalledWith ( "/mock/path/zoo-code-settings.json" , {
1620- providerProfiles : mockProviderProfiles ,
1621- globalSettings : mockGlobalSettings ,
1622- } )
1619+ expect ( safeWriteJson ) . toHaveBeenCalledWith (
1620+ "/mock/path/zoo-code-settings.json" ,
1621+ {
1622+ providerProfiles : mockProviderProfiles ,
1623+ globalSettings : mockGlobalSettings ,
1624+ } ,
1625+ { refuseSymlinkTarget : true } ,
1626+ )
16231627 } )
16241628
16251629 it ( "should include globalSettings when allowedMaxRequests is null" , async ( ) => {
@@ -1648,10 +1652,14 @@ describe("importExport", () => {
16481652 contextProxy : mockContextProxy ,
16491653 } )
16501654
1651- expect ( safeWriteJson ) . toHaveBeenCalledWith ( "/mock/path/zoo-code-settings.json" , {
1652- providerProfiles : mockProviderProfiles ,
1653- globalSettings : mockGlobalSettings ,
1654- } )
1655+ expect ( safeWriteJson ) . toHaveBeenCalledWith (
1656+ "/mock/path/zoo-code-settings.json" ,
1657+ {
1658+ providerProfiles : mockProviderProfiles ,
1659+ globalSettings : mockGlobalSettings ,
1660+ } ,
1661+ { refuseSymlinkTarget : true } ,
1662+ )
16551663 } )
16561664
16571665 it ( "should handle errors during the export process" , async ( ) => {
@@ -1771,10 +1779,14 @@ describe("importExport", () => {
17711779 contextProxy : mockContextProxy ,
17721780 } )
17731781
1774- expect ( safeWriteJson ) . toHaveBeenCalledWith ( "/mock/path/zoo-code-settings.json" , {
1775- providerProfiles : mockProviderProfiles ,
1776- globalSettings : mockGlobalSettings ,
1777- } )
1782+ expect ( safeWriteJson ) . toHaveBeenCalledWith (
1783+ "/mock/path/zoo-code-settings.json" ,
1784+ {
1785+ providerProfiles : mockProviderProfiles ,
1786+ globalSettings : mockGlobalSettings ,
1787+ } ,
1788+ { refuseSymlinkTarget : true } ,
1789+ )
17781790 } )
17791791
17801792 it ( "should export model dimension for OpenAI Compatible provider" , async ( ) => {
@@ -1924,10 +1936,14 @@ describe("importExport", () => {
19241936 } )
19251937
19261938 // Should not throw an error and should preserve original settings
1927- expect ( safeWriteJson ) . toHaveBeenCalledWith ( "/mock/path/zoo-code-settings.json" , {
1928- providerProfiles : mockProviderProfiles ,
1929- globalSettings : mockGlobalSettings , // Should remain unchanged
1930- } )
1939+ expect ( safeWriteJson ) . toHaveBeenCalledWith (
1940+ "/mock/path/zoo-code-settings.json" ,
1941+ {
1942+ providerProfiles : mockProviderProfiles ,
1943+ globalSettings : mockGlobalSettings , // Should remain unchanged
1944+ } ,
1945+ { refuseSymlinkTarget : true } ,
1946+ )
19311947 } )
19321948
19331949 it ( "should maintain backward compatibility with existing exports" , async ( ) => {
@@ -1967,10 +1983,14 @@ describe("importExport", () => {
19671983 } )
19681984
19691985 // Should not modify settings for non-openai-compatible providers
1970- expect ( safeWriteJson ) . toHaveBeenCalledWith ( "/mock/path/zoo-code-settings.json" , {
1971- providerProfiles : mockProviderProfiles ,
1972- globalSettings : mockGlobalSettings , // Should remain unchanged
1973- } )
1986+ expect ( safeWriteJson ) . toHaveBeenCalledWith (
1987+ "/mock/path/zoo-code-settings.json" ,
1988+ {
1989+ providerProfiles : mockProviderProfiles ,
1990+ globalSettings : mockGlobalSettings , // Should remain unchanged
1991+ } ,
1992+ { refuseSymlinkTarget : true } ,
1993+ )
19741994 } )
19751995
19761996 it ( "should handle missing current provider gracefully" , async ( ) => {
@@ -2012,10 +2032,14 @@ describe("importExport", () => {
20122032 } )
20132033
20142034 // Should not throw an error and should preserve original settings
2015- expect ( safeWriteJson ) . toHaveBeenCalledWith ( "/mock/path/zoo-code-settings.json" , {
2016- providerProfiles : mockProviderProfiles ,
2017- globalSettings : mockGlobalSettings , // Should remain unchanged
2018- } )
2035+ expect ( safeWriteJson ) . toHaveBeenCalledWith (
2036+ "/mock/path/zoo-code-settings.json" ,
2037+ {
2038+ providerProfiles : mockProviderProfiles ,
2039+ globalSettings : mockGlobalSettings , // Should remain unchanged
2040+ } ,
2041+ { refuseSymlinkTarget : true } ,
2042+ )
20192043 } )
20202044 } )
20212045
@@ -2249,10 +2273,14 @@ describe("importExport", () => {
22492273 } )
22502274
22512275 // Step 4: Verify the exported data includes the model dimension
2252- expect ( safeWriteJson ) . toHaveBeenCalledWith ( "/mock/path/test-settings.json" , {
2253- providerProfiles : mockProviderProfiles ,
2254- globalSettings : mockGlobalSettings ,
2255- } )
2276+ expect ( safeWriteJson ) . toHaveBeenCalledWith (
2277+ "/mock/path/test-settings.json" ,
2278+ {
2279+ providerProfiles : mockProviderProfiles ,
2280+ globalSettings : mockGlobalSettings ,
2281+ } ,
2282+ { refuseSymlinkTarget : true } ,
2283+ )
22562284
22572285 // Step 5: Get the exported data for import test
22582286 const exportedData = ( safeWriteJson as Mock ) . mock . calls [ 0 ] [ 1 ]
0 commit comments