graph-ecs/tests/query-parser/use.test.js
2024-11-26 15:38:27 -06:00

17 lines
587 B
JavaScript

import { describe, it } from 'node:test'
import assert from '../assert.js'
import { useClause } from '../../src/query-parser/use.js'
import { Identifier, SelectedGraph } from '../../src/query-parser/types.js'
describe('USE keyword', () => {
it('should select a graph to query', () => {
assert.parseOk(useClause, 'USE default', ([actual]) => {
assert.deepEqual(actual, new SelectedGraph(new Identifier('default')))
})
})
it('should return an error if no graph identifier is provided', () => {
assert.parseErr(useClause, 'USE')
})
})