UNPKG

@gameroom/kit

Version:

Node kit for the Gameroom API

33 lines (28 loc) 749 B
const chai = require('chai') const { models: { Counter } } = require('../../') const should = chai.should() let object describe('Counter', () => { describe('Counter.get()', () => { it('should get a counter', async () => { let result, error try { result = await Counter.get() } catch (err) { error = err } should.not.exist(error) should.exist(result) result.should.be.a('object') object = result }) }) describe('Counter keys', () => { it('should match api and kit keys', async () => { const raw = await Counter.schema.adapter.find(Counter.schema, object.id) Object.keys(new Counter()).sort().should.deep.equal(Object.keys(raw).sort()) }) }) })