Skip to content

Commit 4a7f7d4

Browse files
committed
fix: unit
1 parent e318e7e commit 4a7f7d4

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

test/unit/cmap/wire_protocol/on_demand/document.test.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ describe('class OnDemandDocument', () => {
2323
});
2424

2525
context('when given a BSON document with ok set to 1', () => {
26-
it('has a length of 1', () => {
27-
const emptyDocument = BSON.serialize({ ok: 1 });
28-
const doc = new OnDemandDocument(emptyDocument, 0, false);
29-
expect(doc).to.have.lengthOf(1);
30-
});
31-
3226
it('sets exists cache to true for ok', () => {
3327
const emptyDocument = BSON.serialize({ ok: 1 });
3428
const doc = new OnDemandDocument(emptyDocument, 0, false);
@@ -45,12 +39,6 @@ describe('class OnDemandDocument', () => {
4539
});
4640

4741
context('when given a BSON document with ok set to 0 and code set to 2', () => {
48-
it('has a length of 2', () => {
49-
const emptyDocument = BSON.serialize({ ok: 0, code: 2 });
50-
const doc = new OnDemandDocument(emptyDocument, 0, false);
51-
expect(doc).to.have.lengthOf(2);
52-
});
53-
5442
it('tracks element position when finding match', () => {
5543
const emptyDocument = BSON.serialize({ ok: 0, code: 2 });
5644
const doc = new OnDemandDocument(emptyDocument, 0, false);
@@ -200,13 +188,14 @@ describe('class OnDemandDocument', () => {
200188
it('supports returning object', () => {
201189
const o = document.get('object', BSONType.object, true);
202190
expect(o).to.be.instanceOf(OnDemandDocument);
203-
expect(o).to.have.lengthOf(1);
191+
expect(o.has('a')).to.be.true;
204192
});
205193

206194
it('supports returning array', () => {
207195
const a = document.get('array', BSONType.array, true);
208196
expect(a).to.be.instanceOf(OnDemandDocument);
209-
expect(a).to.have.lengthOf(2);
197+
expect(a.has('0')).to.be.true;
198+
expect(a.has('1')).to.be.true;
210199
});
211200
});
212201

0 commit comments

Comments
 (0)