UNPKG

@gameroom/kit

Version:

Node kit for the Gameroom API

54 lines (49 loc) 1.23 kB
const chai = require('chai') const { models: { Unit } } = require('../../') const should = chai.should() let object describe('Unit', () => { describe('Unit.get()', () => { it('should get a unit', async () => { let result, error try { result = await Unit.get({ limit: 1 }) } catch (err) { error = err } should.not.exist(error) should.exist(result) result.should.be.a('array') result.length.should.equal(1) object = result[0] }) }) describe('unit.syncWithShopify()', () => { it('should sync a unit with Shopify', async () => { let result, error try { result = await object.syncWithShopify() } catch (err) { error = err } should.not.exist(result) should.exist(error) error?.response.status.should.equal(401) }) }) describe('Unit.syncWithShopify(id)', () => { it('should sync a unit with Shopify', async () => { let result, error try { result = await Unit.syncWithShopify(object.id) } catch (err) { error = err } should.not.exist(result) should.exist(error) error?.response.status.should.equal(401) }) }) })