Skip to content

Commit 8db6961

Browse files
committed
more idiomatic property test
1 parent 4baafa6 commit 8db6961

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

test/functional/ignore_undefined.test.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ describe('Ignore Undefined', function () {
170170

171171
// Locate the doument
172172
collection.findOne((err, item) => {
173+
expect(err).to.not.exist;
173174
expect(item).to.have.property('a', 1);
174-
expect(item.b).to.be.undefined;
175+
expect(item).to.not.have.property('b');
175176
done();
176177
});
177178
});
@@ -193,8 +194,9 @@ describe('Ignore Undefined', function () {
193194

194195
// Locate the doument
195196
collection.findOne((err, item) => {
197+
expect(err).to.not.exist;
196198
expect(item).to.have.property('a', 1);
197-
expect(item.b).to.be.undefined;
199+
expect(item).to.not.have.property('b');
198200
done();
199201
});
200202
});
@@ -217,7 +219,7 @@ describe('Ignore Undefined', function () {
217219
collection.findOne({}, (err, item) => {
218220
expect(err).to.not.exist;
219221
expect(item).to.have.property('a', 1);
220-
expect(item.b).to.be.undefined;
222+
expect(item).to.not.have.property('b');
221223
done();
222224
});
223225
});
@@ -241,8 +243,9 @@ describe('Ignore Undefined', function () {
241243

242244
// Locate the doument
243245
collection.findOne((err, item) => {
246+
expect(err).to.not.exist;
244247
expect(item).to.have.property('a', 1);
245-
expect(item.b).to.be.undefined;
248+
expect(item).to.not.have.property('b');
246249
done();
247250
});
248251
});
@@ -265,8 +268,9 @@ describe('Ignore Undefined', function () {
265268

266269
// Locate the doument
267270
collection.findOne((err, item) => {
271+
expect(err).to.not.exist;
268272
expect(item).to.have.property('a', 1);
269-
expect(item.b).to.be.undefined;
273+
expect(item).to.not.have.property('b');
270274
done();
271275
});
272276
}

0 commit comments

Comments
 (0)