window-mock
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -23,2 +23,3 @@ 'use strict'; | ||
this._attributes = {}; | ||
this._eventListeners = {}; | ||
this.children = []; | ||
@@ -49,2 +50,7 @@ this.classList = new _classListMock2.default(); | ||
}, { | ||
key: 'addEventListener', | ||
value: function addEventListener(e, f) { | ||
this._eventListeners[e] = f; | ||
} | ||
}, { | ||
key: 'firstChild', | ||
@@ -51,0 +57,0 @@ get: function get() { |
{ | ||
"name": "window-mock", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "A light-weight window mock for Node/io.js unit-testing", | ||
@@ -5,0 +5,0 @@ "main": "lib/window-mock.js", |
@@ -8,2 +8,3 @@ import ClassListMock from './class-list-mock'; | ||
this._attributes = {}; | ||
this._eventListeners = {}; | ||
this.children = []; | ||
@@ -32,4 +33,8 @@ this.classList = new ClassListMock(); | ||
} | ||
addEventListener(e, f) { | ||
this._eventListeners[e] = f; | ||
} | ||
} | ||
export default WindowNodeMock; |
@@ -25,2 +25,6 @@ import test from 'tape'; | ||
t.equal(typeof mock.addEventListener, 'function', 'addEventListener should be a function'); | ||
mock.addEventListener('click', () => { }); | ||
t.equal(typeof mock._eventListeners['click'], 'function', 'addEventListener should append listeners'); | ||
t.end(); | ||
@@ -27,0 +31,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29382
658