Skip to content
This repository has been archived by the owner on Nov 12, 2019. It is now read-only.

Failing test case for issue #40 #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion test/rm.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var crdt = require('..')
var assert = require('assert')

exports.test = function (t) {
exports['test'] = function (t) {
var next = process.nextTick
var doc = new (crdt.Doc)
var set = doc.createSet('type', 'thing')
Expand Down Expand Up @@ -36,3 +36,27 @@ exports.test = function (t) {
})

}

exports['test - with set'] = function (t) {
var next = process.nextTick
var doc = new crdt.Doc()
var hoc = new crdt.Doc()
var ds = doc.createStream()
var hs = hoc.createStream()
ds.pipe(hs).pipe(ds)

doc.add({id: '1', type: 'thing'})

var things = doc.createSet('type', 'thing');

next(function () {
assert.deepEqual(doc.toJSON(), hoc.toJSON())
doc.rm('1');
next(function () {
assert.deepEqual(doc.toJSON(), hoc.toJSON())

t.end()
})
})

}