const assert = require('assert');
const EventEmitter = require('../emitter.js');
describe("Emitter", function () {
let emitter;
beforeEach(function () {
emitter = new EventEmitter();
});
it("can trigger an event", function (done) {
emitter.on("Hello", function () {
done();
});
emitter.trigger("Hello");
});
it("can trigger an event with data", function (done) {
emitter.on("Hello", function (data) {
assert.equal(data, "World");
done();
});
emitter.trigger("Hello", "World");