@@ -8,6 +8,8 @@ import { MergeWithExisting } from './classes';
88import { GenerativeCohereConfig , RerankerCohereConfig } from './types' ;
99
1010describe ( 'Unit testing of the MergeWithExisting class' , ( ) => {
11+ const parse = ( config : any ) => JSON . parse ( JSON . stringify ( config ) ) ;
12+
1113 const invertedIndex : WeaviateInvertedIndexConfig = {
1214 bm25 : {
1315 b : 0.8 ,
@@ -64,7 +66,7 @@ describe('Unit testing of the MergeWithExisting class', () => {
6466 } ;
6567
6668 it ( 'should merge a full invertedIndexUpdate with existing schema' , ( ) => {
67- const merged = MergeWithExisting . invertedIndex ( JSON . parse ( JSON . stringify ( invertedIndex ) ) , {
69+ const merged = MergeWithExisting . invertedIndex ( parse ( invertedIndex ) , {
6870 bm25 : {
6971 b : 0.9 ,
7072 k1 : 1.4 ,
@@ -136,8 +138,6 @@ describe('Unit testing of the MergeWithExisting class', () => {
136138 'reranker-cohere' : { } ,
137139 } ;
138140
139- const parse = ( config : any ) => JSON . parse ( JSON . stringify ( config ) ) ;
140-
141141 it ( 'should merge a partial invertedIndexUpdate with existing schema' , ( ) => {
142142 const merged = MergeWithExisting . invertedIndex ( parse ( invertedIndex ) , {
143143 bm25 : {
@@ -333,7 +333,7 @@ describe('Unit testing of the MergeWithExisting class', () => {
333333 } ) ;
334334
335335 it ( 'should merge a BQ quantizer Flat vectorIndexConfig with existing schema' , ( ) => {
336- const merged = MergeWithExisting . vectors ( JSON . parse ( JSON . stringify ( flatVectorConfig ) ) , [
336+ const merged = MergeWithExisting . vectors ( parse ( flatVectorConfig ) , [
337337 {
338338 name : 'name' ,
339339 vectorIndex : {
0 commit comments