Skip to content

Commit

Permalink
Add .observable() test
Browse files Browse the repository at this point in the history
  • Loading branch information
jbmusso committed Apr 16, 2016
1 parent 6b6059d commit 78490a5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/observable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { createClient } from '../';
import { assert } from 'chai';


describe('.observable()', function () {
it('should return an Observable', function () {
const client = createClient();

const marko = 'marko';
const query = `g.V().has('name', '${marko}').valueMap()`;

const results$ = client.observable(query);

let vertex;
let error;
results$.subscribe(
(result) => vertex = result,
(err) => error = err,
() => {
assert.isUndefined(error);
assert.deepPropertyVal(vertex, 'name[0]', marko);
}
)
});
});

0 comments on commit 78490a5

Please # to comment.