Skip to content

Commit 6d3fe14

Browse files
committed
Fix unknown comparison with number
1 parent f1116fa commit 6d3fe14

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/database-compat/test/transaction.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -847,9 +847,11 @@ describe('Transaction Tests', () => {
847847
ref1.transaction(
848848
current => {
849849
retries++;
850-
// We should be getting server events while the transaction is outstanding.
851-
for (let i = 0; i < (current || 0); i++) {
852-
expect(events[i]).to.equal(i);
850+
if (typeof current === 'number') {
851+
// We should be getting server events while the transaction is outstanding.
852+
for (let i = 0; i < (current || 0); i++) {
853+
expect(events[i]).to.equal(i);
854+
}
853855
}
854856

855857
if (current === SETS - 1) {
@@ -919,7 +921,7 @@ describe('Transaction Tests', () => {
919921
current => {
920922
if (current == null) {
921923
return 0;
922-
} else if (current < COUNT) {
924+
} else if (typeof current === 'number' && current < COUNT) {
923925
return (current as number) + 1;
924926
} else {
925927
shouldCommit = false;

0 commit comments

Comments
 (0)