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

18 lines
550 B
JavaScript
Raw Normal View History

2024-11-10 10:15:43 +01:00
import { describe, it } from 'node:test'
2024-11-13 20:24:29 +01:00
import assert from '../assert.js'
2024-11-10 10:15:43 +01:00
import { statement } from '../../src/query/use.js'
2024-11-13 20:24:29 +01:00
import { Identifier } from '../../src/query/types.js'
2024-11-10 10:15:43 +01:00
2024-11-14 00:32:46 +01:00
describe('USE keyword', () => {
2024-11-10 10:15:43 +01:00
it('should select a graph to query', () => {
2024-11-14 00:32:46 +01:00
assert.parseOk(statement, 'USE default', ([actual]) => {
2024-11-13 20:24:29 +01:00
assert.deepEqual(actual.identifier, new Identifier('default'))
})
2024-11-10 10:15:43 +01:00
})
it('should return an error if no graph identifier is provided', () => {
2024-11-13 20:24:29 +01:00
assert.parseErr(statement, 'USE')
2024-11-10 10:15:43 +01:00
})
})