You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
631 B
21 lines
631 B
/* eslint-env node, mocha */
|
|
/* global artifacts, contract, assert */
|
|
|
|
const Events = artifacts.require('./Events.sol');
|
|
|
|
contract('Events', accounts => {
|
|
it('logs events correctly', done => {
|
|
const loggedEvents = [];
|
|
Events.deployed().then(instance => {
|
|
const allEvents = instance.allEvents();
|
|
|
|
allEvents.on("data", event => { loggedEvents.push(event); });
|
|
|
|
instance.test(5).then(() => {
|
|
const bad = loggedEvents.filter(e => e.event !== 'LogEventOne' && e.event !== 'LogEventTwo');
|
|
assert(bad.length === 0, 'Did not filter events correctly');
|
|
done();
|
|
});
|
|
});
|
|
});
|
|
}); |