|
|
@ -67,6 +67,7 @@ describe('Persistence', function () { |
|
|
|
stream.push(null) |
|
|
|
stream.push(null) |
|
|
|
|
|
|
|
|
|
|
|
d.persistence.treatRawStream(stream, function (err, result) { |
|
|
|
d.persistence.treatRawStream(stream, function (err, result) { |
|
|
|
|
|
|
|
assert.isNull(err) |
|
|
|
const treatedData = result.data |
|
|
|
const treatedData = result.data |
|
|
|
treatedData.sort(function (a, b) { return a._id - b._id }) |
|
|
|
treatedData.sort(function (a, b) { return a._id - b._id }) |
|
|
|
treatedData.length.should.equal(3) |
|
|
|
treatedData.length.should.equal(3) |
|
|
@ -135,6 +136,7 @@ describe('Persistence', function () { |
|
|
|
stream.push(null) |
|
|
|
stream.push(null) |
|
|
|
|
|
|
|
|
|
|
|
d.persistence.treatRawStream(stream, function (err, result) { |
|
|
|
d.persistence.treatRawStream(stream, function (err, result) { |
|
|
|
|
|
|
|
assert.isNull(err) |
|
|
|
const treatedData = result.data |
|
|
|
const treatedData = result.data |
|
|
|
treatedData.sort(function (a, b) { return a._id - b._id }) |
|
|
|
treatedData.sort(function (a, b) { return a._id - b._id }) |
|
|
|
treatedData.length.should.equal(2) |
|
|
|
treatedData.length.should.equal(2) |
|
|
@ -168,6 +170,7 @@ describe('Persistence', function () { |
|
|
|
stream.push(null) |
|
|
|
stream.push(null) |
|
|
|
|
|
|
|
|
|
|
|
d.persistence.treatRawStream(stream, function (err, result) { |
|
|
|
d.persistence.treatRawStream(stream, function (err, result) { |
|
|
|
|
|
|
|
assert.isNull(err) |
|
|
|
const treatedData = result.data |
|
|
|
const treatedData = result.data |
|
|
|
treatedData.sort(function (a, b) { return a._id - b._id }) |
|
|
|
treatedData.sort(function (a, b) { return a._id - b._id }) |
|
|
|
treatedData.length.should.equal(2) |
|
|
|
treatedData.length.should.equal(2) |
|
|
@ -203,6 +206,7 @@ describe('Persistence', function () { |
|
|
|
stream.push(null) |
|
|
|
stream.push(null) |
|
|
|
|
|
|
|
|
|
|
|
d.persistence.treatRawStream(stream, function (err, result) { |
|
|
|
d.persistence.treatRawStream(stream, function (err, result) { |
|
|
|
|
|
|
|
assert.isNull(err) |
|
|
|
const treatedData = result.data |
|
|
|
const treatedData = result.data |
|
|
|
treatedData.sort(function (a, b) { return a._id - b._id }) |
|
|
|
treatedData.sort(function (a, b) { return a._id - b._id }) |
|
|
|
treatedData.length.should.equal(2) |
|
|
|
treatedData.length.should.equal(2) |
|
|
@ -236,6 +240,7 @@ describe('Persistence', function () { |
|
|
|
stream.push(null) |
|
|
|
stream.push(null) |
|
|
|
|
|
|
|
|
|
|
|
d.persistence.treatRawStream(stream, function (err, result) { |
|
|
|
d.persistence.treatRawStream(stream, function (err, result) { |
|
|
|
|
|
|
|
assert.isNull(err) |
|
|
|
const treatedData = result.data |
|
|
|
const treatedData = result.data |
|
|
|
treatedData.sort(function (a, b) { return a._id - b._id }) |
|
|
|
treatedData.sort(function (a, b) { return a._id - b._id }) |
|
|
|
treatedData.length.should.equal(2) |
|
|
|
treatedData.length.should.equal(2) |
|
|
@ -273,6 +278,7 @@ describe('Persistence', function () { |
|
|
|
stream.push(null) |
|
|
|
stream.push(null) |
|
|
|
|
|
|
|
|
|
|
|
d.persistence.treatRawStream(stream, function (err, result) { |
|
|
|
d.persistence.treatRawStream(stream, function (err, result) { |
|
|
|
|
|
|
|
assert.isNull(err) |
|
|
|
const treatedData = result.data |
|
|
|
const treatedData = result.data |
|
|
|
const indexes = result.indexes |
|
|
|
const indexes = result.indexes |
|
|
|
Object.keys(indexes).length.should.equal(1) |
|
|
|
Object.keys(indexes).length.should.equal(1) |
|
|
|