Skip to content

Commit 78490a5

Browse files
committed
Add .observable() test
1 parent 6b6059d commit 78490a5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/observable.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { createClient } from '../';
2+
import { assert } from 'chai';
3+
4+
5+
describe('.observable()', function () {
6+
it('should return an Observable', function () {
7+
const client = createClient();
8+
9+
const marko = 'marko';
10+
const query = `g.V().has('name', '${marko}').valueMap()`;
11+
12+
const results$ = client.observable(query);
13+
14+
let vertex;
15+
let error;
16+
results$.subscribe(
17+
(result) => vertex = result,
18+
(err) => error = err,
19+
() => {
20+
assert.isUndefined(error);
21+
assert.deepPropertyVal(vertex, 'name[0]', marko);
22+
}
23+
)
24+
});
25+
});

0 commit comments

Comments
 (0)