@@ -8,8 +8,6 @@ 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-
1311 const invertedIndex : WeaviateInvertedIndexConfig = {
1412 bm25 : {
1513 b : 0.8 ,
@@ -66,7 +64,7 @@ describe('Unit testing of the MergeWithExisting class', () => {
6664 } ;
6765
6866 it ( 'should merge a full invertedIndexUpdate with existing schema' , ( ) => {
69- const merged = MergeWithExisting . invertedIndex ( parse ( invertedIndex ) , {
67+ const merged = MergeWithExisting . invertedIndex ( JSON . parse ( JSON . stringify ( invertedIndex ) ) , {
7068 bm25 : {
7169 b : 0.9 ,
7270 k1 : 1.4 ,
@@ -138,6 +136,8 @@ describe('Unit testing of the MergeWithExisting class', () => {
138136 'reranker-cohere' : { } ,
139137 } ;
140138
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 ( parse ( flatVectorConfig ) , [
336+ const merged = MergeWithExisting . vectors ( JSON . parse ( JSON . stringify ( flatVectorConfig ) ) , [
337337 {
338338 name : 'name' ,
339339 vectorIndex : {
0 commit comments