graph-ecs/tests/query/use.test.js

20 lines
609 B
JavaScript
Raw Normal View History

2024-11-10 10:15:43 +01:00
import { describe, it } from 'node:test'
import assert from 'node:assert'
import { parse } from '../../src/parser.js'
import { statement } from '../../src/query/use.js'
describe('use parser', () => {
it('should select a graph to query', () => {
const result = parse(statement, 'USE default')
assert(result.isOk())
const [[selected]] = result.value
assert.strictEqual(selected.identifier, 'default')
})
it('should return an error if no graph identifier is provided', () => {
const result = parse(statement, 'USE')
assert(result.isErr())
})
})