@@ -14,17 +14,18 @@ import {
1414 ModuleConfig ,
1515 VectorConfigCreate ,
1616} from '../types/index.js' ;
17- import { configure } from './index.js' ;
17+ import { configure , reconfigure } from './index.js' ;
1818import {
1919 InvertedIndexConfigCreate ,
2020 MultiTenancyConfigCreate ,
2121 ReplicationConfigCreate ,
22+ ReplicationConfigUpdate ,
2223 ShardingConfigCreate ,
2324 VectorIndexConfigFlatCreate ,
2425 VectorIndexConfigHNSWCreate ,
2526} from './types/index.js' ;
2627
27- describe ( 'Unit testing of the configure factory class ' , ( ) => {
28+ describe ( 'Unit testing of the configure & reconfigure factory classes ' , ( ) => {
2829 it ( 'should create the correct InvertedIndexConfig type with all values' , ( ) => {
2930 const config = configure . invertedIndex ( {
3031 bm25b : 0.5 ,
@@ -76,7 +77,7 @@ describe('Unit testing of the configure factory class', () => {
7677 } ) ;
7778 } ) ;
7879
79- it ( 'should create the correct ReplicationConfig type with all values' , ( ) => {
80+ it ( 'should create the correct ReplicationConfigCreate type with all values' , ( ) => {
8081 const config = configure . replication ( {
8182 asyncEnabled : true ,
8283 deletionStrategy : 'DeleteOnConflict' ,
@@ -89,6 +90,19 @@ describe('Unit testing of the configure factory class', () => {
8990 } ) ;
9091 } ) ;
9192
93+ it ( 'should create the correct ReplicationConfigUpdate type with all values' , ( ) => {
94+ const config = reconfigure . replication ( {
95+ asyncEnabled : true ,
96+ deletionStrategy : 'DeleteOnConflict' ,
97+ factor : 2 ,
98+ } ) ;
99+ expect ( config ) . toEqual < ReplicationConfigUpdate > ( {
100+ asyncEnabled : true ,
101+ deletionStrategy : 'DeleteOnConflict' ,
102+ factor : 2 ,
103+ } ) ;
104+ } ) ;
105+
92106 it ( 'should create the correct ShardingConfig type with all values' , ( ) => {
93107 const config = configure . sharding ( {
94108 virtualPerPhysical : 256 ,
0 commit comments