Skip to content

Commit 7f8a30e

Browse files
authored
Merge pull request #6 from reedsy/fix-snapshot-tests
Add null snapshot metadata
2 parents 800d65c + 9b58fc9 commit 7f8a30e

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

test/query.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ module.exports = function() {
3636

3737
it('$sort, $skip and $limit should order, skip and limit', function(done) {
3838
var snapshots = [
39-
{type: 'json0', v: 1, data: {x: 1}, id: "test1"},
40-
{type: 'json0', v: 1, data: {x: 3}, id: "test2"}, // intentionally added out of sort order
41-
{type: 'json0', v: 1, data: {x: 2}, id: "test3"}
39+
{type: 'json0', v: 1, data: {x: 1}, id: "test1", m: null},
40+
{type: 'json0', v: 1, data: {x: 3}, id: "test2", m: null}, // intentionally added out of sort order
41+
{type: 'json0', v: 1, data: {x: 2}, id: "test3", m: null}
4242
];
4343
var query = {$sort: {x: 1}, $skip: 1, $limit: 1};
4444

@@ -72,7 +72,7 @@ module.exports = function() {
7272
];
7373
var snapshotsNoMeta = snapshots.map(function(snapshot) {
7474
var snapshotCopy = JSON.parse(JSON.stringify(snapshot));
75-
delete snapshotCopy.m;
75+
snapshotCopy.m = null;
7676
return snapshotCopy;
7777
});
7878

@@ -123,9 +123,9 @@ module.exports = function() {
123123

124124
it('filters with null condition', function(done) {
125125
var snapshots = [
126-
{type: 'json0', v: 1, data: {x: 1, y: 1}, id: "test1"},
127-
{type: 'json0', v: 1, data: {x: 1}, id: "test2"}, // y value intentionally omitted
128-
{type: 'json0', v: 1, data: {x: 2, y: 2}, id: "test3"}
126+
{type: 'json0', v: 1, data: {x: 1, y: 1}, id: "test1", m: null},
127+
{type: 'json0', v: 1, data: {x: 1}, id: "test2", m: null}, // y value intentionally omitted
128+
{type: 'json0', v: 1, data: {x: 2, y: 2}, id: "test3", m: null}
129129
];
130130
var query = {y: null};
131131

@@ -145,9 +145,9 @@ module.exports = function() {
145145

146146
describe('top-level boolean operator', function() {
147147
var snapshots = [
148-
{type: 'json0', v: 1, data: {x: 1, y: 1}, id: "test1"},
149-
{type: 'json0', v: 1, data: {x: 1, y: 2}, id: "test2"},
150-
{type: 'json0', v: 1, data: {x: 2, y: 2}, id: "test3"}
148+
{type: 'json0', v: 1, data: {x: 1, y: 1}, id: "test1", m: null},
149+
{type: 'json0', v: 1, data: {x: 1, y: 2}, id: "test2", m: null},
150+
{type: 'json0', v: 1, data: {x: 2, y: 2}, id: "test3", m: null}
151151
];
152152

153153
beforeEach(function(done) {

0 commit comments

Comments
 (0)