Permalink
Browse files

test that add({...}) set props before "add" event

  • Loading branch information...
1 parent 271baf3 commit 7d89100e04ee7f632ea87e73e023c32e0131c696 @dominictarr committed Nov 29, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 test/add.js
View
@@ -0,0 +1,17 @@
+
+var crdt = require('..')
+var assert = require('assert')
+
+exports.test = function (t) {
+ var doc = new (crdt.Doc)
+
+ var init = {id: 'taonihu', prop: 'key'}
+
+ doc.on('create', function (row) {
+ assert.deepEqual(row.toJSON(), init)
+ })
+
+ doc.add(init)
+
+ t.end()
+}

0 comments on commit 7d89100

Please sign in to comment.