@@ -8,8 +8,6 @@ import { MergeWithExisting } from './classes';
8
8
import { GenerativeCohereConfig , RerankerCohereConfig } from './types' ;
9
9
10
10
describe ( 'Unit testing of the MergeWithExisting class' , ( ) => {
11
- const parse = ( config : any ) => JSON . parse ( JSON . stringify ( config ) ) ;
12
-
13
11
const invertedIndex : WeaviateInvertedIndexConfig = {
14
12
bm25 : {
15
13
b : 0.8 ,
@@ -66,7 +64,7 @@ describe('Unit testing of the MergeWithExisting class', () => {
66
64
} ;
67
65
68
66
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 ) ) , {
70
68
bm25 : {
71
69
b : 0.9 ,
72
70
k1 : 1.4 ,
@@ -138,6 +136,8 @@ describe('Unit testing of the MergeWithExisting class', () => {
138
136
'reranker-cohere' : { } ,
139
137
} ;
140
138
139
+ const parse = ( config : any ) => JSON . parse ( JSON . stringify ( config ) ) ;
140
+
141
141
it ( 'should merge a partial invertedIndexUpdate with existing schema' , ( ) => {
142
142
const merged = MergeWithExisting . invertedIndex ( parse ( invertedIndex ) , {
143
143
bm25 : {
@@ -333,7 +333,7 @@ describe('Unit testing of the MergeWithExisting class', () => {
333
333
} ) ;
334
334
335
335
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 ) ) , [
337
337
{
338
338
name : 'name' ,
339
339
vectorIndex : {
0 commit comments