mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-01-31 16:35:23 +00:00
commit
3c910db730
@ -62,7 +62,7 @@ export class EventTracker {
|
||||
|
||||
public track(
|
||||
event: string,
|
||||
properties: EventTrackProperties | Error,
|
||||
properties: EventTrackProperties | Error = { },
|
||||
) {
|
||||
|
||||
if (properties instanceof Error) {
|
||||
|
@ -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'
|
||||
|
@ -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
14
test/18-startup.coffee
Normal 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
|
Loading…
x
Reference in New Issue
Block a user