Merge pull request #741 from resin-io/fixes

Minor bugfixes
This commit is contained in:
CameronDiver 2018-09-04 16:09:07 -07:00 committed by GitHub
commit 3c910db730
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 2 deletions

View File

@ -62,7 +62,7 @@ export class EventTracker {
public track(
event: string,
properties: EventTrackProperties | Error,
properties: EventTrackProperties | Error = { },
) {
if (properties instanceof Error) {

View File

@ -6,7 +6,7 @@ Config = require './config'
APIBinder = require './api-binder'
DeviceState = require './device-state'
SupervisorAPI = require './supervisor-api'
Logger = require './logger'
{ Logger } = require './logger'
{ checkTruthy } = require './lib/validation';
constants = require './lib/constants'

View File

@ -87,6 +87,9 @@ describe 'EventTracker', ->
supervisorVersion
})
it 'should handle being passed no properties object', ->
expect(@eventTracker.track('no-options')).to.not.throw
describe 'Rate limiting', ->
it 'should rate limit events of the same type', ->

14
test/18-startup.coffee Normal file
View File

@ -0,0 +1,14 @@
m = require 'mochainon'
{ expect } = m.chai
Supervisor = require '../src/supervisor'
describe 'Startup', ->
it 'should startup correctly', ->
supervisor = new Supervisor()
expect(supervisor.init()).to.not.throw
expect(supervisor.db).to.not.be.null
expect(supervisor.config).to.not.be.null
expect(supervisor.logger).to.not.be.null
expect(supervisor.deviceState).to.not.be.null
expect(supervisor.apiBinder).to.not.be.null