Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit db0e90f

Browse files
committedOct 20, 2024·
Update tests
1 parent 3eb0c34 commit db0e90f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎test/domain.test.ts

+13
Original file line numberDiff line numberDiff line change
@@ -501,13 +501,21 @@ describe('store: [adapter=DOMAIN]', () => {
501501

502502
globalStore.initialize(adapter)(callback);
503503

504+
expect(globalStore.reset).to.not.throw('Async store not initialized.');
505+
504506
globalStore.reset();
505507

506508
expect(globalStore.isInitialized()).to.equal(false);
507509

508510
const activeDomain = getActiveDomain();
509511
expect(activeDomain[STORE_KEY]).to.equal(null);
510512
});
513+
514+
it('should do nothing if the store is not initialized.', () => {
515+
expect(globalStore.reset).to.throw('Async store not initialized.');
516+
});
517+
518+
511519
});
512520

513521
describe('del():', () => {
@@ -536,6 +544,7 @@ describe('store: [adapter=DOMAIN]', () => {
536544
expect(globalStore.get('foo')).to.equal('foo');
537545
expect(globalStore.get('bar')).to.equal('bar');
538546

547+
expect(globalStore.del.bind(globalStore, 'baz')).to.not.throw('Async store not initialized.');
539548
globalStore.del('baz');
540549

541550
expect(globalStore.get('foo')).to.equal('foo');
@@ -546,6 +555,10 @@ describe('store: [adapter=DOMAIN]', () => {
546555

547556
globalStore.initialize(adapter)(callback);
548557
});
558+
559+
it('should do nothing if the store is not initialized.', () => {
560+
expect(globalStore.del.bind(globalStore, 'foo')).to.throw('Async store not initialized.');
561+
});
549562
});
550563

551564
describe('Test Cases:', () => {

0 commit comments

Comments
 (0)
Please sign in to comment.