UNPKG

availity-ekko

Version:

Mock server simulating Availity API rest services

44 lines (31 loc) 884 B
/* globals describe, it */ 'use strict'; const chai = require('chai'); const path = require('path'); const expect = chai.expect; const Ekko = require('../index'); describe('Ekko', function() { it('should be defined', function() { expect(Ekko).to.be.exist; }); describe('Events', function() { it('should emit started event when started', function(done) { const ekko = new Ekko(path.join(__dirname, 'test-config.js')); ekko.on('av:started', function() { ekko.stop().then(function() { done(); }); }); ekko.start(); }); it('should emit stopped event when stopped', function(done) { const ekko = new Ekko(path.join(__dirname, 'test-config.js')); ekko.on('av:stopped', function() { done(); }); ekko.start().then(function() { ekko.stop(); }); }); }); });