fix test imports

This commit is contained in:
Rowan 2024-11-20 13:21:41 -06:00
parent effd541093
commit 6b3539e3c8
7 changed files with 14 additions and 11 deletions

View file

@ -1,7 +1,7 @@
import { describe, it } from 'node:test' import { describe, it } from 'node:test'
import assert from '../assert.js' import assert from '../assert.js'
import { Alias, Identifier, Literal, ObjectPath } from '../../src/query/types.js' import { Alias, Identifier, Literal, ObjectPath } from '../../src/query-parser/types.js'
import { baseValue, literal, value } from '../../src/query/common.js' import { baseValue, literal, value } from '../../src/query-parser/common.js'
describe('common parser library', () => { describe('common parser library', () => {
const literals = [ const literals = [

View file

@ -1,6 +1,6 @@
import { describe, it } from 'node:test' import { describe, it } from 'node:test'
import assert from '../assert.js' import assert from '../assert.js'
import { node, edge, matchClause } from '../../src/query/match.js' import { node, edge, matchClause } from '../../src/query-parser/match.js'
import { makeDirectedEdge, makeEdge, makeNode, makeRelationship } from '../utils.js' import { makeDirectedEdge, makeEdge, makeNode, makeRelationship } from '../utils.js'
describe('node', () => { describe('node', () => {

View file

@ -1,7 +1,7 @@
import { describe, it } from 'node:test' import { describe, it } from 'node:test'
import assert from '../assert.js' import assert from '../assert.js'
import { query } from '../../src/query/index.js' import { query } from '../../src/query-parser/index.js'
import { Alias, Identifier, ObjectPath, Query, ReturnValues, SelectedGraph } from '../../src/query/types.js' import { Alias, Identifier, ObjectPath, Query, ReturnValues, SelectedGraph } from '../../src/query-parser/types.js'
import { makeNode, makeRelationship, makeRightEdge } from '../utils.js' import { makeNode, makeRelationship, makeRightEdge } from '../utils.js'
const path = (...v) => new ObjectPath(...v) const path = (...v) => new ObjectPath(...v)

View file

@ -1,7 +1,7 @@
import { describe, it } from 'node:test' import { describe, it } from 'node:test'
import assert from '../assert.js' import assert from '../assert.js'
import { returnClause } from '../../src/query/return.js' import { returnClause } from '../../src/query-parser/return.js'
import { Alias, Identifier, Literal, ReturnValues } from '../../src/query/types.js' import { Alias, Identifier, Literal, ReturnValues } from '../../src/query-parser/types.js'
describe('RETURN keyword', () => { describe('RETURN keyword', () => {
it('should collect a single value for a query to return', () => { it('should collect a single value for a query to return', () => {

View file

@ -1,7 +1,7 @@
import { describe, it } from 'node:test' import { describe, it } from 'node:test'
import assert from '../assert.js' import assert from '../assert.js'
import { useClause } from '../../src/query/use.js' import { useClause } from '../../src/query-parser/use.js'
import { Identifier } from '../../src/query/types.js' import { Identifier } from '../../src/query-parser/types.js'
describe('USE keyword', () => { describe('USE keyword', () => {
it('should select a graph to query', () => { it('should select a graph to query', () => {

View file

@ -55,7 +55,10 @@ describe('query', () => {
const q = 'MATCH (player:Player)-[e1:Knows]->(a:NPC)-[e2:Knows]->(b:NPC) RETURN player, e1, a, e2, b' const q = 'MATCH (player:Player)-[e1:Knows]->(a:NPC)-[e2:Knows]->(b:NPC) RETURN player, e1, a, e2, b'
const result = query(q, engine) const result = query(q, engine)
console.log(`parsing ${q}\n`, result.unwrap()) assert.deepEqual(result.unwrap(), [
{ player: 0, e1: 4, a: 1, e2: 7, b: 2 },
{ player: 0, e1: 4, a: 1, e2: 8, b: 3 }
])
}) })
}) })

View file

@ -1,4 +1,4 @@
import { KeyValuePair, Name, Label, Identifier, Literal, Edge, Node, DirectedEdge, Relationship } from '../src/query/types.js' import { KeyValuePair, Name, Label, Identifier, Literal, Edge, Node, DirectedEdge, Relationship } from '../src/query-parser/types.js'
export const keyValuePair = ([k, v]) => new KeyValuePair(new Name(new Identifier(k)), new Literal(v)) export const keyValuePair = ([k, v]) => new KeyValuePair(new Name(new Identifier(k)), new Literal(v))