@@ -137,7 +137,7 @@ describe('EppoPrecomputedClient E2E test', () => {
137137 ) ;
138138 } ) ;
139139
140- it ( 'logs error when initialized with store without salt' , ( ) => {
140+ it ( 'logs errors when constructor receives an uninitialized store without a salt' , ( ) => {
141141 const nonemptyStore = new MemoryOnlyConfigurationStore < PrecomputedFlag > ( ) ;
142142 // Incorrectly initialized: no salt, not set to initialized
143143 jest . spyOn ( nonemptyStore , 'getKeys' ) . mockReturnValue ( [ 'some-key' ] ) ;
@@ -156,6 +156,27 @@ describe('EppoPrecomputedClient E2E test', () => {
156156 '[Eppo SDK] EppoPrecomputedClient requires a precomputedFlagStore with a salt if requestParameters are not provided' ,
157157 ) ;
158158 } ) ;
159+
160+ it ( 'only logs initialization error when constructor receives an uninitialized store with salt' , ( ) => {
161+ const nonemptyStore = new MemoryOnlyConfigurationStore < PrecomputedFlag > ( ) ;
162+ nonemptyStore . salt = 'nacl' ;
163+ // Incorrectly initialized: no salt, not set to initialized
164+ jest . spyOn ( nonemptyStore , 'getKeys' ) . mockReturnValue ( [ 'some-key' ] ) ;
165+
166+ new EppoPrecomputedClient ( {
167+ precomputedFlagStore : nonemptyStore ,
168+ subject : {
169+ subjectKey : '' ,
170+ subjectAttributes : { } ,
171+ } ,
172+ } ) ;
173+ expect ( mockError ) . toHaveBeenCalledWith (
174+ '[Eppo SDK] EppoPrecomputedClient requires an initialized precomputedFlagStore if requestParameters are not provided' ,
175+ ) ;
176+ expect ( mockError ) . not . toHaveBeenCalledWith (
177+ '[Eppo SDK] EppoPrecomputedClient requires a precomputedFlagStore with a salt if requestParameters are not provided' ,
178+ ) ;
179+ } ) ;
159180 } ) ;
160181
161182 describe ( 'setLogger' , ( ) => {
0 commit comments