18 lines
589 B
JavaScript
18 lines
589 B
JavaScript
import { describe, it } from 'node:test'
|
|
import assert from '../assert.js'
|
|
import { parse } from '../../src/parser.js'
|
|
import { statement } from '../../src/query/use.js'
|
|
import { Identifier } from '../../src/query/types.js'
|
|
|
|
describe('use parser', () => {
|
|
it('should select a graph to query', () => {
|
|
assert.parseOk(statement, 'USE default', actual => {
|
|
assert.deepEqual(actual.identifier, new Identifier('default'))
|
|
})
|
|
})
|
|
|
|
it('should return an error if no graph identifier is provided', () => {
|
|
assert.parseErr(statement, 'USE')
|
|
})
|
|
})
|
|
|