@@ -43,12 +43,12 @@ describe(`SchemaHandler`, function () {
4343 } ;
4444
4545 beforeEach ( function ( ) {
46- mockServerless = JSON . parse ( JSON . stringify ( serverlessMock ) ) ;
47- modelsDocument = JSON . parse ( JSON . stringify ( modelsDocumentOG ) ) ;
48- modelsAltDocument = JSON . parse ( JSON . stringify ( modelsAltDocumentOG ) ) ;
49- modelsListDocument = JSON . parse ( JSON . stringify ( modelsListDocumentOG ) ) ;
50- modelsListAltDocument = JSON . parse ( JSON . stringify ( modelsListAltDocumentOG ) ) ;
51- openAPI = JSON . parse ( JSON . stringify ( openAPISchema ) ) ;
46+ mockServerless = structuredClone ( serverlessMock ) ;
47+ modelsDocument = structuredClone ( modelsDocumentOG ) ;
48+ modelsAltDocument = structuredClone ( modelsAltDocumentOG ) ;
49+ modelsListDocument = structuredClone ( modelsListDocumentOG ) ;
50+ modelsListAltDocument = structuredClone ( modelsListAltDocumentOG ) ;
51+ openAPI = structuredClone ( openAPISchema ) ;
5252 } ) ;
5353
5454 describe ( `constuctor` , function ( ) {
@@ -135,7 +135,7 @@ describe(`SchemaHandler`, function () {
135135 } ) ;
136136
137137 it ( `should standardise mixed models syntax in to the correct format` , function ( ) {
138- const newModelsDocument = JSON . parse ( JSON . stringify ( modelsDocument ) ) ;
138+ const newModelsDocument = structuredClone ( modelsDocument ) ;
139139 Object . assign (
140140 mockServerless . service . custom . documentation ,
141141 newModelsDocument
@@ -168,9 +168,7 @@ describe(`SchemaHandler`, function () {
168168 } ) ;
169169
170170 it ( `should standardise mixed modelsList syntax in to the correct format` , function ( ) {
171- const newModelsDocument = JSON . parse (
172- JSON . stringify ( modelsListDocument )
173- ) ;
171+ const newModelsDocument = structuredClone ( modelsListDocument ) ;
174172 Object . assign (
175173 mockServerless . service . custom . documentation ,
176174 newModelsDocument
@@ -203,9 +201,7 @@ describe(`SchemaHandler`, function () {
203201 } ) ;
204202
205203 it ( `should standardise mixed models and modelsList syntax in to the correct format` , function ( ) {
206- const newModelsDocument = JSON . parse (
207- JSON . stringify ( modelsListDocument )
208- ) ;
204+ const newModelsDocument = structuredClone ( modelsListDocument ) ;
209205 Object . assign (
210206 mockServerless . service . custom . documentation ,
211207 newModelsDocument
0 commit comments