Skip to content

Commit

Permalink
Larger test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
paberr committed Dec 19, 2017
1 parent e66e93a commit b52abbf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions src/test/generic/CombinedTransaction.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,19 @@ describe('CombinedTransaction', () => {
expect(objectStore1._stateStack.length).toBe(2);
expect(objectStore2._stateStack.length).toBe(2);

tx1 = objectStore1.transaction();
tx2 = objectStore2.transaction();
await tx1.remove('key4');
await tx2.remove('key4');

expect(await JungleDB.commitCombined(tx1, tx2)).toBe(true);
expect(objectStore1._stateStack.length).toBe(3);
expect(objectStore2._stateStack.length).toBe(3);

await blockingTx1.abort();

expect(objectStore1._stateStack.length).toBe(2);
expect(objectStore2._stateStack.length).toBe(2);
expect(objectStore1._stateStack.length).toBe(3);
expect(objectStore2._stateStack.length).toBe(3);

await blockingTx2.abort();

Expand Down
13 changes: 11 additions & 2 deletions src/test/generic/CombinedTransactionPlatform.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,19 @@ describe('CombinedTransactionPlatform', () => {
expect(objectStore1._stateStack.length).toBe(2);
expect(objectStore2._stateStack.length).toBe(2);

tx1 = objectStore1.transaction();
tx2 = objectStore2.transaction();
await tx1.remove('key4');
await tx2.remove('key4');

expect(await JungleDB.commitCombined(tx1, tx2)).toBe(true);
expect(objectStore1._stateStack.length).toBe(3);
expect(objectStore2._stateStack.length).toBe(3);

await blockingTx1.abort();

expect(objectStore1._stateStack.length).toBe(2);
expect(objectStore2._stateStack.length).toBe(2);
expect(objectStore1._stateStack.length).toBe(3);
expect(objectStore2._stateStack.length).toBe(3);

await blockingTx2.abort();

Expand Down

0 comments on commit b52abbf

Please sign in to comment.