@@ -8,6 +8,8 @@ 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
+
11
13
const invertedIndex : WeaviateInvertedIndexConfig = {
12
14
bm25 : {
13
15
b : 0.8 ,
@@ -64,7 +66,7 @@ describe('Unit testing of the MergeWithExisting class', () => {
64
66
} ;
65
67
66
68
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 ) , {
68
70
bm25 : {
69
71
b : 0.9 ,
70
72
k1 : 1.4 ,
@@ -136,8 +138,6 @@ describe('Unit testing of the MergeWithExisting class', () => {
136
138
'reranker-cohere' : { } ,
137
139
} ;
138
140
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 ( JSON . parse ( JSON . stringify ( flatVectorConfig ) ) , [
336
+ const merged = MergeWithExisting . vectors ( parse ( flatVectorConfig ) , [
337
337
{
338
338
name : 'name' ,
339
339
vectorIndex : {
0 commit comments