Skip to content

Instantly share code, notes, and snippets.

@pori
Created July 5, 2016 04:28
Show Gist options
  • Save pori/90c97dc05ecdb1e5174a4c78e8dae1f7 to your computer and use it in GitHub Desktop.
Save pori/90c97dc05ecdb1e5174a4c78e8dae1f7 to your computer and use it in GitHub Desktop.
import test from 'ava';
import EventTarget from '../build';
class Window extends EventTarget {}
test(t => {
const window = new Window();
const type = 'load';
const cb = (event) => t.pass();
window.addEventListener(type, cb);
window.dispatchEvent({
type: type
});
window.removeEventListener(type, cb);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment