UNPKG

evrythng

Version:

Official Javascript SDK for the EVRYTHNG API.

22 lines (17 loc) 520 B
const { expect } = require('chai') const { getScope, mockApi } = require('../util') module.exports = (url) => { describe('Device', () => { let device, api before(() => { device = getScope('device') api = mockApi(url) }) it('should represent a Thng', async () => { api.get('/thngs/deviceThngId').reply(200, { id: 'deviceThngId', apiKey: 'apiKey' }) const res = await device.init() expect(res).to.be.an('object') expect(res.apiKey).to.be.a('string') }) }) }