Skip to content

Commit f1e3dba

Browse files
committed
added test case
1 parent a57fb90 commit f1e3dba

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/ChainCache.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,17 @@ describe('ChainCache', () => {
179179
});
180180
});
181181
describe('onChange', () => {
182+
it('should fire onCacheInitialized event when cache is initialized', async () => {
183+
const cache = new ChainCache();
184+
let cacheInitialized = false;
185+
cache.on('onCacheInitialized', () => {
186+
cacheInitialized = true;
187+
});
188+
cache.bulkAddPairs([
189+
{ pair: ['abc', 'xyz'], strategies: [encodedStrategy1] },
190+
]);
191+
expect(cacheInitialized).to.be.true;
192+
});
182193
it('should fire onPairAddedToCache event when pair is added', async () => {
183194
const cache = new ChainCache();
184195
let affectedPair: TokenPair = ['', ''];

0 commit comments

Comments
 (0)