Add reset and del functionality#144
Add reset and del functionality#144samirsilwal wants to merge 5 commits intoleapfrogtechnology:mainfrom
Conversation
|
Some issue with codecov package 🤷 which breaks the CI |
|
@samirsilwal Need to do the same here for codecov. Thanks! 😄 |
Cool will create a PR |
5201173 to
a57ab86
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #144 +/- ##
==========================================
- Coverage 87.75% 84.43% -3.33%
==========================================
Files 5 5
Lines 147 167 +20
Branches 25 28 +3
==========================================
+ Hits 129 141 +12
- Misses 15 21 +6
- Partials 3 5 +2 ☔ View full report in Codecov by Sentry. |
d1fef5b to
f164356
Compare
f164356 to
db0e90f
Compare
|
@samirsilwal I haven't checked but seems like codecov is not happy because we didn't cover some lines that were added. Did you check? |
| reset: () => void; | ||
| del: (key: string) => void; |
| expect(globalStore.get('foo')).to.equal('foo'); | ||
| expect(globalStore.get('bar')).to.equal('bar'); | ||
|
|
||
| expect(globalStore.del.bind(globalStore, 'baz')).to.not.throw('Async store not initialized.'); |
There was a problem hiding this comment.
We don't need this expect here as you have a separate test if the store is not initialized.
| }); | ||
|
|
||
| it('should do nothing if the store is not initialized.', () => { | ||
| expect(globalStore.del.bind(globalStore, 'foo')).to.throw('Async store not initialized.'); |
There was a problem hiding this comment.
Sorry, why do we need to .bind here?
Changes
resetfunction to purge the store. It helps to clear out the store once the use is completed