@@ -12,7 +12,7 @@ describe('embedded', () => {
1212 expect ( opt . persistenceDataPath ) . toEqual ( join ( homedir ( ) , '.local/share/weaviate' ) ) ;
1313 expect ( opt . host ) . toEqual ( '127.0.0.1' ) ;
1414 expect ( opt . port ) . toEqual ( 6666 ) ;
15- expect ( opt . clusterHostname ) . toEqual ( 'embedded ') ;
15+ expect ( opt . env ) . toHaveProperty ( 'CLUSTER_HOSTNAME' , 'Embedded_at_6666 ') ;
1616 } ) ;
1717
1818 it ( 'creates EmbeddedOptions with custom options' , ( ) => {
@@ -33,10 +33,17 @@ describe('embedded', () => {
3333 expect ( opt . env ) . toHaveProperty ( 'ENABLE_MODULES' , 'text2vec-contextionary' ) ;
3434 expect ( opt . env ) . toHaveProperty ( 'CONTEXTIONARY_URL' , 'contextionary:9999' ) ;
3535 expect ( opt . env ) . toHaveProperty ( 'QUERY_DEFAULTS_LIMIT' , 100 ) ;
36+ expect ( opt . env ) . toHaveProperty ( 'CLUSTER_HOSTNAME' , 'Embedded_at_7777' ) ;
3637 expect ( opt . host ) . toEqual ( 'somehost.com' ) ;
3738 expect ( opt . port ) . toEqual ( 7777 ) ;
3839 } ) ;
3940
41+ it ( 'overrides default env vars with inherited exported ones' , ( ) => {
42+ process . env . CLUSTER_HOSTNAME = 'custom-hostname' ;
43+ const opt = new EmbeddedOptions ( ) ;
44+ expect ( opt . env ) . toHaveProperty ( 'CLUSTER_HOSTNAME' , 'custom-hostname' ) ;
45+ } ) ;
46+
4047 it ( 'failed to create EmbeddedOptions with invalid version' , ( ) => {
4148 return expect ( ( ) => {
4249 const opt = new EmbeddedOptions ( {
0 commit comments