-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reset and del functionality #144
base: main
Are you sure you want to change the base?
Add reset and del functionality #144
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@samirsilwal Please update the README as well.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, why do we need to .bind
here?
Changes
reset
function to purge the store. It helps to clear out the store once the use is completed