@gameroom/kit
Version:
Node kit for the Gameroom API
76 lines (72 loc) • 1.97 kB
JavaScript
const chai = require('chai')
const {
lib: { Comparison }
} = require('../../')
const should = chai.should()
describe('Comparison', () => {
describe('Comparison("=")', () => {
it('should get equal_to comparison', () => {
const comparison = Comparison('=')
should.exist(comparison)
})
})
describe('Comparison("!=")', () => {
it('should get not_equal_to comparison', () => {
const comparison = Comparison('!=')
should.exist(comparison)
})
})
describe('Comparison(">")', () => {
it('should get greater_than comparison', () => {
const comparison = Comparison('>')
should.exist(comparison)
})
})
describe('Comparison(">=")', () => {
it('should get greater_than_or_equal_to comparison', () => {
const comparison = Comparison('>=')
should.exist(comparison)
})
})
describe('Comparison("<")', () => {
it('should get less_than comparison', () => {
const comparison = Comparison('<')
should.exist(comparison)
})
})
describe('Comparison("<=")', () => {
it('should get less_than_or_equal_to comparison', () => {
const comparison = Comparison('<=')
should.exist(comparison)
})
})
describe('Comparison("contains")', () => {
it('should get contains comparison', () => {
const comparison = Comparison('contains')
should.exist(comparison)
})
})
describe('Comparison("~")', () => {
it('should get like comparison', () => {
const comparison = Comparison('~')
should.exist(comparison)
})
})
describe('Comparison("inside")', () => {
it('should get in comparison', () => {
const comparison = Comparison('inside')
should.exist(comparison)
})
})
describe('Comparison("err")', () => {
it('should throw an error', () => {
let error
try {
Comparison('err')
} catch (err) {
error = err
}
should.exist(error)
})
})
})