1
- import { beforeEach , describe , expect , test , vi } from 'vitest'
1
+ import { beforeEach , deepClone , describe , expect , test , vi } from 'vitest'
2
2
3
3
import { svelteTesting } from '../vite.js'
4
4
import { IS_JEST } from './utils.js'
@@ -45,7 +45,7 @@ describe.skipIf(IS_JEST)('vite plugin', () => {
45
45
'adds browser condition if necessary' ,
46
46
( { config, expectedConditions } ) => {
47
47
const subject = svelteTesting ( )
48
- const viteConfig = structuredClone ( config )
48
+ const viteConfig = deepClone ( config )
49
49
50
50
subject . config ( viteConfig )
51
51
@@ -74,7 +74,7 @@ describe.skipIf(IS_JEST)('vite plugin', () => {
74
74
'skips browser condition if possible' ,
75
75
( { config, expectedConditions } ) => {
76
76
const subject = svelteTesting ( )
77
- const viteConfig = structuredClone ( config )
77
+ const viteConfig = deepClone ( config )
78
78
79
79
subject . config ( viteConfig )
80
80
@@ -104,7 +104,7 @@ describe.skipIf(IS_JEST)('vite plugin', () => {
104
104
} ,
105
105
] ) ( 'adds cleanup' , ( { config, expectedSetupFiles } ) => {
106
106
const subject = svelteTesting ( )
107
- const viteConfig = structuredClone ( config )
107
+ const viteConfig = deepClone ( config )
108
108
109
109
subject . config ( viteConfig )
110
110
@@ -134,7 +134,7 @@ describe.skipIf(IS_JEST)('vite plugin', () => {
134
134
} ,
135
135
] ) ( 'adds noExternal rule' , ( { config, expectedNoExternal } ) => {
136
136
const subject = svelteTesting ( )
137
- const viteConfig = structuredClone ( config )
137
+ const viteConfig = deepClone ( config )
138
138
139
139
subject . config ( viteConfig )
140
140
@@ -160,7 +160,7 @@ describe.skipIf(IS_JEST)('vite plugin', () => {
160
160
} ,
161
161
] ) ( 'skips noExternal if able' , ( { config, expectedNoExternal } ) => {
162
162
const subject = svelteTesting ( )
163
- const viteConfig = structuredClone ( config )
163
+ const viteConfig = deepClone ( config )
164
164
165
165
subject . config ( viteConfig )
166
166
@@ -173,7 +173,7 @@ describe.skipIf(IS_JEST)('vite plugin', () => {
173
173
174
174
test ( 'bails on noExternal if input is unexpected' , ( ) => {
175
175
const subject = svelteTesting ( )
176
- const viteConfig = structuredClone ( { ssr : { noExternal : false } } )
176
+ const viteConfig = deepClone ( { ssr : { noExternal : false } } )
177
177
178
178
subject . config ( viteConfig )
179
179
0 commit comments