Skip to content

Commit b3c260a

Browse files
committed
fix graph tests
1 parent bb9a024 commit b3c260a

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

packages/graph/lib/commands/EXPLAIN.spec.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ describe('EXPLAIN', () => {
1111
});
1212

1313
testUtils.testWithClient('client.graph.explain', async client => {
14-
const reply = await client.graph.explain('key', 'RETURN 0');
14+
const [, reply] = await Promise.all([
15+
client.graph.query('key', 'RETURN 0'), // make sure to create a graph first
16+
client.graph.explain('key', 'RETURN 0')
17+
]);
1518
assert.ok(Array.isArray(reply));
1619
assert.ok(!reply.find(x => typeof x !== 'string'));
1720
}, GLOBAL.SERVERS.OPEN);

packages/graph/lib/commands/RO_QUERY.spec.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ describe('RO_QUERY', () => {
1111
});
1212

1313
testUtils.testWithClient('client.graph.roQuery', async client => {
14-
const { data } = await client.graph.roQuery('key', 'RETURN 0');
14+
const [, { data }] = await Promise.all([
15+
client.graph.query('key', 'RETURN 0'), // make sure to create a graph first
16+
client.graph.roQuery('key', 'RETURN 0')
17+
]);
1518
assert.deepEqual(data, [[0]]);
1619
}, GLOBAL.SERVERS.OPEN);
1720
});

packages/graph/lib/graph.spec.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Graph from './graph';
55
describe('Graph', () => {
66
testUtils.testWithClient('null', async client => {
77
const graph = new Graph(client as any, 'graph'),
8-
{ data } = await graph.roQuery('RETURN null AS key');
8+
{ data } = await graph.query('RETURN null AS key');
99

1010
assert.deepEqual(
1111
data,
@@ -15,7 +15,7 @@ describe('Graph', () => {
1515

1616
testUtils.testWithClient('string', async client => {
1717
const graph = new Graph(client as any, 'graph'),
18-
{ data } = await graph.roQuery('RETURN "string" AS key');
18+
{ data } = await graph.query('RETURN "string" AS key');
1919

2020
assert.deepEqual(
2121
data,
@@ -25,7 +25,7 @@ describe('Graph', () => {
2525

2626
testUtils.testWithClient('integer', async client => {
2727
const graph = new Graph(client as any, 'graph'),
28-
{ data } = await graph.roQuery('RETURN 0 AS key');
28+
{ data } = await graph.query('RETURN 0 AS key');
2929

3030
assert.deepEqual(
3131
data,
@@ -35,7 +35,7 @@ describe('Graph', () => {
3535

3636
testUtils.testWithClient('boolean', async client => {
3737
const graph = new Graph(client as any, 'graph'),
38-
{ data } = await graph.roQuery('RETURN false AS key');
38+
{ data } = await graph.query('RETURN false AS key');
3939

4040
assert.deepEqual(
4141
data,
@@ -45,7 +45,7 @@ describe('Graph', () => {
4545

4646
testUtils.testWithClient('double', async client => {
4747
const graph = new Graph(client as any, 'graph'),
48-
{ data } = await graph.roQuery('RETURN 0.1 AS key');
48+
{ data } = await graph.query('RETURN 0.1 AS key');
4949

5050
assert.deepEqual(
5151
data,
@@ -55,7 +55,7 @@ describe('Graph', () => {
5555

5656
testUtils.testWithClient('array', async client => {
5757
const graph = new Graph(client as any, 'graph'),
58-
{ data } = await graph.roQuery('RETURN [null] AS key');
58+
{ data } = await graph.query('RETURN [null] AS key');
5959

6060
assert.deepEqual(
6161
data,
@@ -125,7 +125,7 @@ describe('Graph', () => {
125125

126126
testUtils.testWithClient('map', async client => {
127127
const graph = new Graph(client as any, 'graph'),
128-
{ data } = await graph.roQuery('RETURN { key: "value" } AS map');
128+
{ data } = await graph.query('RETURN { key: "value" } AS map');
129129

130130
assert.deepEqual(data, [{
131131
map: {
@@ -136,7 +136,7 @@ describe('Graph', () => {
136136

137137
testUtils.testWithClient('point', async client => {
138138
const graph = new Graph(client as any, 'graph'),
139-
{ data } = await graph.roQuery('RETURN point({ latitude: 1, longitude: 2 }) AS point');
139+
{ data } = await graph.query('RETURN point({ latitude: 1, longitude: 2 }) AS point');
140140

141141
assert.deepEqual(data, [{
142142
point: {

0 commit comments

Comments
 (0)