Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
test: Fix "Setting 5 items should increase length to 5" test consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
Alorel committed Jul 10, 2019
1 parent fdea64e commit 3d134de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion projects/ngforage/package.json
@@ -1,6 +1,6 @@
{
"name": "ngforage",
"version": "5.0.0",
"version": "5.0.1",
"peerDependencies": {
"@angular/common": "^8.0.0",
"@angular/core": "^8.0.0",
Expand Down
4 changes: 3 additions & 1 deletion projects/ngforage/src/lib/main/ng-forage.service.spec.ts
Expand Up @@ -252,7 +252,8 @@ describe('NgForage core service', () => {
describe('#clear & #length', () => {

it('Length should be 0 initially', done => {
inst.length()
inst.clear()
.then(() => inst.length())
.then(l => {
expect(l).toBe(0);
done();
Expand All @@ -263,6 +264,7 @@ describe('NgForage core service', () => {
it('Setting 5 items should increase length to 5', async done => {
const r = 5;

await inst.clear();
await Promise.all(range(r).map((v: number) => inst.setItem(v.toString(), v)));

expect(await inst.length()).toBe(r);
Expand Down

0 comments on commit 3d134de

Please sign in to comment.