{"size": 668, "ext": "js", "max_stars_repo_path": "test/stop-immediate-propagation.test.js", "max_stars_repo_name": "chung-leong/relaks-event-emitter", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/stop-immediate-propagation.test.js", "max_issues_repo_name": "chung-leong/relaks-event-emitter", "max_issues_repo_issues_event_min_datetime": "2021-03-08T22:56:34.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-12T04:05:44.000Z", "max_forks_repo_path": "test/stop-immediate-propagation.test.js", "max_forks_repo_name": "trambarhq/relaks-event-emitter", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 30.3636363636, "max_line_length": 71, "alphanum_fraction": 0.619760479}
import { expect } from 'chai';
import { EventEmitter, GenericEvent } from '../index.mjs';

describe('#stopImmediatePropagation()', function() {
  it ('should keep additional handlers from being called', function() {
    const emitter = new EventEmitter;
    const called = [];
    emitter.addEventListener('change', (evt) => {
      called.push('a');
      evt.stopImmediatePropagation();
    });
    emitter.addEventListener('change', (evt) => {
      called.push('b');
    });
    emitter.addEventListener('change', (evt) => {
      called.push('c');
    });
    emitter.triggerEvent(new GenericEvent('change', emitter));
    expect(called).to.eql([ 'a' ]);
  })
})
