test('should update the document with an error', function(test) {
  coux.waitForDoc(testDb, chId, 1, function(err, doc) {
    if (doc.state != "error") return true;
    test.is(doc.state, "error");
    test.end();
  });
});
test('should update the document', function(test) {
  coux.waitForDoc(testDb, chId, 1, function(err, doc) {
    if (doc.state == "new") return true;
    if (doc.error) console.log("doc.error", doc.error)
    test.is(doc.state, "ready", "channel ready");
    cloudDb = doc.cloud_database;
    test.end();
  });
});