Convert test/18-startup.coffee to typescript

Change-type: patch
This commit is contained in:
Pagan Gazzard 2020-03-31 17:01:29 +01:00
parent 70b0705551
commit d3221ca235
2 changed files with 16 additions and 13 deletions

View File

@ -1,13 +0,0 @@
{ expect } = require './lib/chai-config'
{ 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

16
test/18-startup.ts Normal file
View File

@ -0,0 +1,16 @@
import { Supervisor } from '../src/supervisor';
import { expect } from './lib/chai-config';
describe('Startup', () => {
it('should startup correctly', function() {
const supervisor = new Supervisor();
expect(supervisor.init()).to.not.throw;
// Cast as any to access private properties
const anySupervisor = supervisor as any;
expect(anySupervisor.db).to.not.be.null;
expect(anySupervisor.config).to.not.be.null;
expect(anySupervisor.logger).to.not.be.null;
expect(anySupervisor.deviceState).to.not.be.null;
expect(anySupervisor.apiBinder).to.not.be.null;
});
});