Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

happy-dom

Package Overview
Dependencies
Maintainers
1
Versions
593
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

happy-dom - npm Package Compare versions

Comparing version 0.4.11 to 0.5.0

lib/AsyncManager.d.ts

11

lib/event/EventTarget.js

@@ -41,7 +41,3 @@ "use strict";

EventTarget.prototype.dispatchEvent = function (event) {
var onEventName = 'on' + event.type.toLowerCase();
var returnValue = true;
if (typeof this[onEventName] === 'function') {
this[onEventName].call(this, event);
}
if (this._listeners[event.type]) {

@@ -59,9 +55,2 @@ for (var _i = 0, _a = this._listeners[event.type]; _i < _a.length; _i++) {

}
if (event.bubbles &&
this['parentNode'] !== null &&
typeof this['parentNode'] === 'object' &&
typeof this['parentNode'].dispatchEvent === 'function' &&
!this['parentNode'].dispatchEvent(event)) {
returnValue = false;
}
return returnValue;

@@ -68,0 +57,0 @@ };

4

lib/html-element/ClassList.js

@@ -63,3 +63,5 @@ "use strict";

ClassList.prototype.contains = function (className) {
return this.ownerElement.getAttribute('class').includes(className);
var attr = this.ownerElement.getAttribute('class');
var list = attr ? attr.split(' ') : [];
return list.includes(className);
};

@@ -66,0 +68,0 @@ return ClassList;

@@ -27,3 +27,3 @@ "use strict";

var tagName = element.tagName.toLowerCase();
var rawAttributes = element.getRawAttributes();
var rawAttributes = element._getRawAttributes();
var isUnClosed = META_REGEXP.test(tagName);

@@ -30,0 +30,0 @@ var isSelfClosed = SELF_CLOSED_REGEXP.test(tagName);

@@ -36,3 +36,3 @@ "use strict";

while ((match = attributeRegexp.exec(part))) {
if (element.attributesMap[match[1]] !== match[2].replace(/"/g, '')) {
if (element._attributesMap[match[1]] !== match[2].replace(/"/g, '')) {
return false;

@@ -44,6 +44,5 @@ }

if (this.isClass) {
var className = element.className;
var classRegexp = new RegExp(CLASS_REGEXP, 'g');
while ((match = classRegexp.exec(part))) {
if (!className || !className.includes(match[1])) {
if (!element.classList.contains(match[1])) {
return false;

@@ -50,0 +49,0 @@ }

@@ -1,2 +0,2 @@

import Document from '../nodes/basic-types/Document';
import Document from '../nodes/basic-types/document/Document';
import Window from '../Window';

@@ -3,0 +3,0 @@ /**

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var Document_1 = __importDefault(require("../nodes/basic-types/Document"));
var Document_1 = __importDefault(require("../nodes/basic-types/document/Document"));
/**

@@ -9,0 +9,0 @@ * The DOMImplementation interface represents an object providing methods which are not dependent on any particular document. Such an object is returned by the

@@ -71,4 +71,4 @@ "use strict";

// MutationObserver
if (this.observers.length > 0) {
for (var _i = 0, _a = this.observers; _i < _a.length; _i++) {
if (this._observers.length > 0) {
for (var _i = 0, _a = this._observers; _i < _a.length; _i++) {
var observer = _a[_i];

@@ -75,0 +75,0 @@ if (observer.options.characterData) {

@@ -90,5 +90,6 @@ import Element from './Element';

* @legacy
* @param {string} type Type.
* @return {Event} Event.
*/
createEvent(): Event;
createEvent(type: string): Event;
/**

@@ -95,0 +96,0 @@ * Imports a node.

@@ -164,6 +164,7 @@ "use strict";

* @legacy
* @param {string} type Type.
* @return {Event} Event.
*/
Document.prototype.createEvent = function () {
return new Event_1.default();
Document.prototype.createEvent = function (type) {
return new Event_1.default(type);
};

@@ -170,0 +171,0 @@ /**

@@ -16,3 +16,5 @@ import Node from './Node';

classList: ClassList;
readonly attributesMap: {
scrollTop: number;
scrollLeft: number;
_attributesMap: {
[k: string]: string;

@@ -141,7 +143,7 @@ };

*/
setRawAttributes(rawAttributes: string): void;
_setRawAttributes(rawAttributes: string): void;
/**
* Returns raw attributes.
*/
getRawAttributes(): string;
_getRawAttributes(): string;
/**

@@ -154,2 +156,8 @@ * Attaches a shadow root.

/**
* Scrolls to a particular set of coordinates in the document.
*
* @note This method has not been implemented. It is just here for compatibility.
*/
scrollTo(): void;
/**
* Converts to string.

@@ -156,0 +164,0 @@ *

@@ -44,3 +44,5 @@ "use strict";

_this.classList = new ClassList_1.default(_this);
_this.attributesMap = {};
_this.scrollTop = 0;
_this.scrollLeft = 0;
_this._attributesMap = {};
return _this;

@@ -193,7 +195,7 @@ }

var attributes = [];
for (var _i = 0, _a = Object.keys(this.attributesMap); _i < _a.length; _i++) {
for (var _i = 0, _a = Object.keys(this._attributesMap); _i < _a.length; _i++) {
var key = _a[_i];
var attribute = new Attribute_1.default();
attribute.name = key;
attribute.value = this.attributesMap[key];
attribute.value = this._attributesMap[key];
attributes.push(attribute);

@@ -237,3 +239,3 @@ }

Element.prototype.hasAttributes = function () {
return Object.keys(this.attributesMap).length > 0;
return Object.keys(this._attributesMap).length > 0;
};

@@ -248,4 +250,4 @@ /**

var lowerName = name.toLowerCase();
var oldValue = this.attributesMap[lowerName] !== undefined ? this.attributesMap[lowerName] : null;
this.attributesMap[lowerName] = String(value);
var oldValue = this._attributesMap[lowerName] !== undefined ? this._attributesMap[lowerName] : null;
this._attributesMap[lowerName] = String(value);
if (this.attributeChangedCallback) {

@@ -255,4 +257,4 @@ this.attributeChangedCallback(name, oldValue, value);

// MutationObserver
if (this.observers.length > 0) {
for (var _i = 0, _a = this.observers; _i < _a.length; _i++) {
if (this._observers.length > 0) {
for (var _i = 0, _a = this._observers; _i < _a.length; _i++) {
var observer = _a[_i];

@@ -277,3 +279,3 @@ if (observer.options.attributes &&

var lowerName = name.toLowerCase();
return this.attributesMap[lowerName] !== undefined ? this.attributesMap[lowerName] : null;
return this._attributesMap[lowerName] !== undefined ? this._attributesMap[lowerName] : null;
};

@@ -287,7 +289,7 @@ /**

var lowerName = name.toLowerCase();
var oldValue = this.attributesMap[lowerName] !== undefined ? this.attributesMap[lowerName] : null;
delete this.attributesMap[lowerName];
var oldValue = this._attributesMap[lowerName] !== undefined ? this._attributesMap[lowerName] : null;
delete this._attributesMap[lowerName];
// MutationObserver
if (this.observers.length > 0) {
for (var _i = 0, _a = this.observers; _i < _a.length; _i++) {
if (this._observers.length > 0) {
for (var _i = 0, _a = this._observers; _i < _a.length; _i++) {
var observer = _a[_i];

@@ -310,3 +312,3 @@ if (observer.options.attributes &&

*/
Element.prototype.setRawAttributes = function (rawAttributes) {
Element.prototype._setRawAttributes = function (rawAttributes) {
rawAttributes = rawAttributes.trim();

@@ -317,5 +319,5 @@ if (rawAttributes) {

while ((match = attributeRegexp.exec(rawAttributes))) {
var name_1 = match[1].toLowerCase();
var name = match[1].toLowerCase();
var value = he_1.decode(match[2] || match[3] || match[4] || '');
this.attributesMap[name_1] = value;
this._attributesMap[name] = value;
}

@@ -327,7 +329,7 @@ }

*/
Element.prototype.getRawAttributes = function () {
Element.prototype._getRawAttributes = function () {
var _this = this;
return Object.keys(this.attributesMap)
return Object.keys(this._attributesMap)
.map(function (key) {
return key + '="' + he_1.encode(_this.attributesMap[key]) + '"';
return key + '="' + he_1.encode(_this._attributesMap[key]) + '"';
})

@@ -351,2 +353,8 @@ .join(' ');

/**
* Scrolls to a particular set of coordinates in the document.
*
* @note This method has not been implemented. It is just here for compatibility.
*/
Element.prototype.scrollTo = function () { };
/**
* Converts to string.

@@ -353,0 +361,0 @@ *

@@ -27,11 +27,11 @@ import Element from '../element/Element';

/**
* Blur.
* Triggers a click event.
*/
blur(): void;
click(): void;
/**
* Click.
* Triggers a blur event.
*/
click(): void;
blur(): void;
/**
* Focus.
* Triggers a focus event.
*/

@@ -38,0 +38,0 @@ focus(): void;

@@ -20,2 +20,3 @@ "use strict";

var Element_1 = __importDefault(require("../element/Element"));
var Event_1 = __importDefault(require("../../../event/Event"));
/**

@@ -57,13 +58,19 @@ * HTMLElement.

/**
* Blur.
* Triggers a click event.
*/
HTMLElement.prototype.blur = function () { };
HTMLElement.prototype.click = function () {
this.dispatchEvent(new Event_1.default('click'));
};
/**
* Click.
* Triggers a blur event.
*/
HTMLElement.prototype.click = function () { };
HTMLElement.prototype.blur = function () {
this.dispatchEvent(new Event_1.default('blur'));
};
/**
* Focus.
* Triggers a focus event.
*/
HTMLElement.prototype.focus = function () { };
HTMLElement.prototype.focus = function () {
this.dispatchEvent(new Event_1.default('focus'));
};
/**

@@ -70,0 +77,0 @@ * Sets an attribute.

@@ -11,2 +11,6 @@ import Element from './Element';

tabIndex: number;
offsetHeight: number;
offsetWidth: number;
offsetLeft: number;
offsetTop: number;
/**

@@ -49,7 +53,7 @@ * Returns inner text.

*/
setRawAttributes(rawAttributes: string): void;
_setRawAttributes(rawAttributes: string): void;
/**
* Defines initial properties.
*/
private defineInitialProperties;
private _defineInitialProperties;
}

@@ -29,2 +29,6 @@ "use strict";

_this.tabIndex = 0;
_this.offsetHeight = 0;
_this.offsetWidth = 0;
_this.offsetLeft = 0;
_this.offsetTop = 0;
return _this;

@@ -76,3 +80,3 @@ }

var observedAttributes = Object.keys(observedPropertyAttributes);
if (observedAttributes.includes(lowerName)) {
if (value !== null && value !== undefined && observedAttributes.includes(lowerName)) {
var property = observedPropertyAttributes[lowerName];

@@ -88,6 +92,6 @@ this[property] = typeof this[property] === 'boolean' ? value !== null : String(value);

*/
HTMLElement.prototype.setRawAttributes = function (rawAttributes) {
_super.prototype.setRawAttributes.call(this, rawAttributes);
HTMLElement.prototype._setRawAttributes = function (rawAttributes) {
_super.prototype._setRawAttributes.call(this, rawAttributes);
if (rawAttributes.trim()) {
this.defineInitialProperties();
this._defineInitialProperties();
}

@@ -98,9 +102,9 @@ };

*/
HTMLElement.prototype.defineInitialProperties = function () {
HTMLElement.prototype._defineInitialProperties = function () {
var observedPropertyAttributes = this.constructor._observedPropertyAttributes;
for (var _i = 0, _a = Object.keys(observedPropertyAttributes); _i < _a.length; _i++) {
var name_1 = _a[_i];
var attribute = this.attributesMap[name_1];
if (attribute !== null) {
var property = observedPropertyAttributes[name_1];
var name = _a[_i];
var attribute = this._attributesMap[name];
if (attribute !== null && attribute !== undefined) {
var property = observedPropertyAttributes[name];
switch (typeof this[property]) {

@@ -107,0 +111,0 @@ case 'boolean':

@@ -15,3 +15,3 @@ import NodeType from './NodeType';

protected _isConnected: boolean;
protected observers: MutationObserverListener[];
protected _observers: MutationObserverListener[];
/**

@@ -83,8 +83,2 @@ * Constructor.

/**
* Returns a unique ID.
*
* @return {string} ID.
*/
getUniqueID(): string;
/**
* Clones a node.

@@ -131,3 +125,3 @@ *

*/
observe(listener: MutationObserverListener): void;
_observe(listener: MutationObserverListener): void;
/**

@@ -139,3 +133,3 @@ * Stops observing the node.

*/
unobserve(listener: MutationObserverListener): void;
_unobserve(listener: MutationObserverListener): void;
}

@@ -24,3 +24,2 @@ "use strict";

var MutationType_1 = __importDefault(require("../../mutation-observer/MutationType"));
var ASCII = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
/**

@@ -42,3 +41,3 @@ * Node

// Custom Properties (not part of HTML standard)
_this.observers = [];
_this._observers = [];
_this.ownerDocument = _this.constructor.ownerDocument;

@@ -183,15 +182,2 @@ return _this;

/**
* Returns a unique ID.
*
* @return {string} ID.
*/
Node.prototype.getUniqueID = function () {
if (this.parentNode) {
var childNodeIndex = this.parentNode.childNodes.indexOf(this);
var id = ASCII[childNodeIndex] !== undefined ? ASCII[childNodeIndex] : childNodeIndex !== -1 ? childNodeIndex : '';
return this.parentNode.getUniqueID() + id;
}
return 'a';
};
/**
* Clones a node.

@@ -207,3 +193,3 @@ *

var key = _a[_i];
if (key !== '_isConnected' && key !== 'observers') {
if (key !== '_isConnected' && key !== '_observers') {
if (key === 'childNodes') {

@@ -229,2 +215,5 @@ if (deep) {

}
else if (key === '_attributesMap') {
clone[key] = Object.assign({}, this[key]);
}
else {

@@ -264,10 +253,10 @@ clone[key] = this[key];

// MutationObserver
if (this.observers.length > 0) {
if (this._observers.length > 0) {
var record = new MutationRecord_1.default();
record.type = MutationType_1.default.childList;
record.addedNodes = [node];
for (var _b = 0, _c = this.observers; _b < _c.length; _b++) {
for (var _b = 0, _c = this._observers; _b < _c.length; _b++) {
var observer = _c[_b];
if (observer.options.subtree) {
node.observe(observer);
node._observe(observer);
}

@@ -295,9 +284,9 @@ if (observer.options.childList) {

// MutationObserver
if (this.observers.length > 0) {
if (this._observers.length > 0) {
var record = new MutationRecord_1.default();
record.type = MutationType_1.default.childList;
record.removedNodes = [node];
for (var _i = 0, _a = this.observers; _i < _a.length; _i++) {
for (var _i = 0, _a = this._observers; _i < _a.length; _i++) {
var observer = _a[_i];
node.unobserve(observer);
node._unobserve(observer);
if (observer.options.childList) {

@@ -341,10 +330,10 @@ observer.callback([record]);

// MutationObserver
if (this.observers.length > 0) {
if (this._observers.length > 0) {
var record = new MutationRecord_1.default();
record.type = MutationType_1.default.childList;
record.addedNodes = [newNode];
for (var _b = 0, _c = this.observers; _b < _c.length; _b++) {
for (var _b = 0, _c = this._observers; _b < _c.length; _b++) {
var observer = _c[_b];
if (observer.options.subtree) {
newNode.observe(observer);
newNode._observe(observer);
}

@@ -376,8 +365,8 @@ if (observer.options.childList) {

*/
Node.prototype.observe = function (listener) {
this.observers.push(listener);
Node.prototype._observe = function (listener) {
this._observers.push(listener);
if (listener.options.subtree) {
for (var _i = 0, _a = this.childNodes; _i < _a.length; _i++) {
var node = _a[_i];
node.observe(listener);
node._observe(listener);
}

@@ -392,6 +381,6 @@ }

*/
Node.prototype.unobserve = function (listener) {
var index = this.observers.indexOf(listener);
Node.prototype._unobserve = function (listener) {
var index = this._observers.indexOf(listener);
if (index !== -1) {
this.observers.splice(index, 1);
this._observers.splice(index, 1);
}

@@ -401,3 +390,3 @@ if (listener.options.subtree) {

var node = _a[_i];
node.unobserve(listener);
node._unobserve(listener);
}

@@ -404,0 +393,0 @@ }

@@ -5,2 +5,3 @@ import NodeType from './NodeType';

import MutationObserverListener from '../../../mutation-observer/MutationListener';
import Event from '../../../event/Event';
/**

@@ -119,2 +120,10 @@ * Node

/**
* Dispatches an event.
*
* @override
* @param {Event} event Event.
* @return {boolean} The return value is false if event is cancelable and at least one of the event handlers which handled this event called Event.preventDefault()
*/
dispatchEvent(event: Event): boolean;
/**
* Observeres the node.

@@ -121,0 +130,0 @@ * Used by MutationObserver, but it is not part of the HTML standard.

@@ -352,2 +352,20 @@ "use strict";

/**
* Dispatches an event.
*
* @override
* @param {Event} event Event.
* @return {boolean} The return value is false if event is cancelable and at least one of the event handlers which handled this event called Event.preventDefault()
*/
Node.prototype.dispatchEvent = function (event) {
var onEventName = 'on' + event.type.toLowerCase();
if (typeof this[onEventName] === 'function') {
this[onEventName].call(this, event);
}
var returnValue = _super.prototype.dispatchEvent.call(this, event);
if (event.bubbles && this.parentNode !== null && !this.dispatchEvent(event)) {
returnValue = false;
}
return returnValue;
};
/**
* Observeres the node.

@@ -354,0 +372,0 @@ * Used by MutationObserver, but it is not part of the HTML standard.

@@ -71,4 +71,4 @@ "use strict";

// MutationObserver
if (this.observers.length > 0) {
for (var _i = 0, _a = this.observers; _i < _a.length; _i++) {
if (this._observers.length > 0) {
for (var _i = 0, _a = this._observers; _i < _a.length; _i++) {
var observer = _a[_i];

@@ -75,0 +75,0 @@ if (observer.options.characterData) {

@@ -159,3 +159,3 @@ "use strict";

get: function () {
return this.type !== 'hidden' && this.type !== 'reset' && this.type !== 'button' && !this.disabled && !this['readOnly'];
return (this.type !== 'hidden' && this.type !== 'reset' && this.type !== 'button' && !this.disabled && !this['readOnly']);
},

@@ -162,0 +162,0 @@ enumerable: true,

import HTMLElement from '../basic-types/HTMLElement';
import Node from '../basic-types/Node';
import HTMLFormElement from './HTMLFormElement';
/**

@@ -16,5 +17,3 @@ * HTMLTextAreaElement.

"value": string;
"autocomplete": string; /**
* HTMLTextAreaElement.
*/
"autocomplete": string;
"minlength": string;

@@ -21,0 +20,0 @@ "maxlength": string;

import ScopedCSSCache from './css/ScopedCSSCache';
import Element from '../nodes/basic-types/Element';
import DocumentFragment from '../nodes/basic-types/DocumentFragment';
import Element from '../nodes/basic-types/element/Element';
import DocumentFragment from '../nodes/basic-types/document-fragment/DocumentFragment';
/**

@@ -5,0 +5,0 @@ * Patch for scoping elements when requesting "document.documentElement.innerHTML" or "document.documentElement.outerHTML".

@@ -6,4 +6,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var Element_1 = __importDefault(require("../nodes/basic-types/Element"));
var ShadowRoot_1 = __importDefault(require("../nodes/basic-types/ShadowRoot"));
var Element_1 = __importDefault(require("../nodes/basic-types/element/Element"));
var ShadowRoot_1 = __importDefault(require("../nodes/basic-types/shadow-root/ShadowRoot"));
var ScopeCSS_1 = __importDefault(require("./css/ScopeCSS"));

@@ -49,11 +49,11 @@ /**

var child = element.children[i];
var name_1 = child.getAttribute('slot') || 'default';
slotChildren[name_1] = slotChildren[name_1] || [];
slotChildren[name_1].push(child);
var name = child.getAttribute('slot') || 'default';
slotChildren[name] = slotChildren[name] || [];
slotChildren[name].push(child);
}
for (var _i = 0, slots_1 = slots; _i < slots_1.length; _i++) {
var slot = slots_1[_i];
var name_2 = slot.getAttribute('name') || 'default';
if (slotChildren[name_2]) {
for (var _a = 0, _b = slotChildren[name_2]; _a < _b.length; _a++) {
var name = slot.getAttribute('name') || 'default';
if (slotChildren[name]) {
for (var _a = 0, _b = slotChildren[name]; _a < _b.length; _a++) {
var child = _b[_a];

@@ -60,0 +60,0 @@ slot.parentNode.insertBefore(child, slot);

{
"name": "happy-dom",
"version": "0.4.11",
"version": "0.5.0",
"license": "MIT",

@@ -39,3 +39,4 @@ "homepage": "https://github.com/capricorn86/happy-dom#readme",

"**/test/**/*.test.ts"
]
],
"testEnvironment": "node"
},

@@ -42,0 +43,0 @@ "dependencies": {

@@ -221,2 +221,3 @@ # Happy DOM

| ------- | ---------- | ---------------- |
| 0.5.0 | 2019-10-21 | Adds support for click(), focus() and blur(). (#8) |
| 0.4.4 | 2019-10-20 | Fixes issue with CustomEvent not being defined correctly causing issues with detail property. (#10) |

@@ -223,0 +224,0 @@ | 0.4.3 | 2019-10-08 | Fixes issue with cloned nodes referring to the same attributes, which is causing weird issues in lit-html. (#5) |

@@ -42,9 +42,4 @@ import Event from './Event';

public dispatchEvent(event: Event): boolean {
const onEventName = 'on' + event.type.toLowerCase();
let returnValue = true;
if (typeof this[onEventName] === 'function') {
this[onEventName].call(this, event);
}
if (this._listeners[event.type]) {

@@ -62,14 +57,4 @@ for (const listener of this._listeners[event.type]) {

if (
event.bubbles &&
this['parentNode'] !== null &&
typeof this['parentNode'] === 'object' &&
typeof this['parentNode'].dispatchEvent === 'function' &&
!this['parentNode'].dispatchEvent(event)
) {
returnValue = false;
}
return returnValue;
}
}
import Element from '../element/Element';
import Event from '../../../event/Event';

@@ -34,15 +35,21 @@ /**

/**
* Blur.
* Triggers a click event.
*/
public blur(): void {}
public click(): void {
this.dispatchEvent(new Event('click'));
}
/**
* Click.
* Triggers a blur event.
*/
public click(): void {}
public blur(): void {
this.dispatchEvent(new Event('blur'));
}
/**
* Focus.
* Triggers a focus event.
*/
public focus(): void {}
public focus(): void {
this.dispatchEvent(new Event('focus'));
}

@@ -49,0 +56,0 @@ /**

@@ -8,2 +8,3 @@ import NodeType from './NodeType';

import MutationObserverListener from '../../../mutation-observer/MutationListener';
import Event from '../../../event/Event';

@@ -347,2 +348,25 @@ /**

/**
* Dispatches an event.
*
* @override
* @param {Event} event Event.
* @return {boolean} The return value is false if event is cancelable and at least one of the event handlers which handled this event called Event.preventDefault()
*/
public dispatchEvent(event: Event): boolean {
const onEventName = 'on' + event.type.toLowerCase();
if (typeof this[onEventName] === 'function') {
this[onEventName].call(this, event);
}
let returnValue = super.dispatchEvent(event);
if (event.bubbles && this.parentNode !== null && !this.dispatchEvent(event)) {
returnValue = false;
}
return returnValue;
}
/**
* Observeres the node.

@@ -349,0 +373,0 @@ * Used by MutationObserver, but it is not part of the HTML standard.

import EventTarget from '../../lib/event/EventTarget';
import Event from '../../lib/event/Event';
import CustomEvent from '../../lib/event/CustomEvent';

@@ -25,2 +26,15 @@ const EVENT_TYPE = 'click';

});
test('Triggers a custom event and triggers it when calling dispatchEvent().', () => {
let recievedEvent: CustomEvent = null;
const DETAIL = {};
const listener = (event: CustomEvent): void => {
recievedEvent = event;
};
const dispatchedEvent = new CustomEvent(EVENT_TYPE, { detail: DETAIL });
eventTarget.addEventListener(EVENT_TYPE, listener);
eventTarget.dispatchEvent(dispatchedEvent);
expect(recievedEvent).toBe(dispatchedEvent);
expect(recievedEvent.detail).toBe(DETAIL);
});
});

@@ -27,0 +41,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc