@gameroom/kit
Version:
Node kit for the Gameroom API
33 lines (29 loc) • 984 B
JavaScript
const { faker } = require('@faker-js/faker'),
chai = require('chai')
const {
lib: { Expression }
} = require('../../')
const should = chai.should()
describe('Expression', () => {
describe('new Expression()', () => {
it('should create a new Expression with default values', () => {
const expression = new Expression()
should.exist(expression)
should.equal(expression.comparison, 'equal_to')
should.equal(expression.key, null)
should.equal(expression.value, null)
})
})
describe('new Expression({})', () => {
it('should create a new Expression with provided values', () => {
const comparison = '='
const key = faker.random.word()
const value = faker.random.word()
const expression = new Expression({ comparison, key, value })
should.exist(expression)
expression.comparison.should.equal('equal_to')
expression.key.should.equal(key)
expression.value.should.equal(value)
})
})
})