-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the ability clear items using wildcard characters
- Loading branch information
1 parent
df0a9a8
commit 624708c
Showing
3 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
jest.unmock('../index'); | ||
import Medusa from '../index'; | ||
|
||
describe('Clear many from storage', () => { | ||
|
||
pit('gets the results of a promise', () => { | ||
|
||
return Medusa.get('sample1', function(resolve, reject) { | ||
resolve('success'); | ||
}, 1000) | ||
.then(res => expect(res).toEqual('success')) | ||
.then(res => { | ||
return Medusa.get('sample2', function(resolve, reject) { | ||
resolve('success'); | ||
}, 1000) | ||
.then(res => expect(res).toEqual('success')); | ||
}) | ||
.then(res => { | ||
return Medusa.clear('samp*'); | ||
}) | ||
.then(res => { | ||
return Medusa.get('sample1', function(resolve, reject) { | ||
resolve('failure'); | ||
}, 1000) | ||
.then(res => expect(res).toEqual('failure')); | ||
}) | ||
.then(res => { | ||
return Medusa.get('sample2', function(resolve, reject) { | ||
resolve('failure'); | ||
}, 1000) | ||
.then(res => expect(res).toEqual('failure')); | ||
}); | ||
|
||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters