diff --git a/test/fixtures/expectedProperties.json b/test/fixtures/expectedProperties.json new file mode 100644 index 0000000..94d23e3 --- /dev/null +++ b/test/fixtures/expectedProperties.json @@ -0,0 +1,213 @@ +[ + "DOMException", + "NamedNodeMap", + "Attr", + "Node", + "Element", + "DocumentFragment", + "HTMLDocument", + "Document", + "XMLDocument", + "CharacterData", + "Text", + "CDATASection", + "ProcessingInstruction", + "Comment", + "DocumentType", + "DOMImplementation", + "Event", + "CustomEvent", + "MessageEvent", + "ErrorEvent", + "HashChangeEvent", + "FocusEvent", + "PopStateEvent", + "UIEvent", + "MouseEvent", + "KeyboardEvent", + "TouchEvent", + "ProgressEvent", + "EventTarget", + "Location", + "History", + "Blob", + "File", + "FileList", + "DOMParser", + "FormData", + "HTMLElement", + "HTMLAnchorElement", + "HTMLAppletElement", + "HTMLAreaElement", + "HTMLAudioElement", + "HTMLBaseElement", + "HTMLBodyElement", + "HTMLBRElement", + "HTMLButtonElement", + "HTMLCanvasElement", + "HTMLDataElement", + "HTMLDataListElement", + "HTMLDialogElement", + "HTMLDirectoryElement", + "HTMLDivElement", + "HTMLDListElement", + "HTMLEmbedElement", + "HTMLFieldSetElement", + "HTMLFontElement", + "HTMLFormElement", + "HTMLFrameElement", + "HTMLFrameSetElement", + "HTMLHeadingElement", + "HTMLHeadElement", + "HTMLHRElement", + "HTMLHtmlElement", + "HTMLIFrameElement", + "HTMLImageElement", + "HTMLInputElement", + "HTMLLabelElement", + "HTMLLegendElement", + "HTMLLIElement", + "HTMLLinkElement", + "HTMLMapElement", + "HTMLMediaElement", + "HTMLMenuElement", + "HTMLMetaElement", + "HTMLMeterElement", + "HTMLModElement", + "HTMLObjectElement", + "HTMLOListElement", + "HTMLOptGroupElement", + "HTMLOptionElement", + "HTMLOutputElement", + "HTMLParagraphElement", + "HTMLParamElement", + "HTMLPreElement", + "HTMLProgressElement", + "HTMLQuoteElement", + "HTMLScriptElement", + "HTMLSelectElement", + "HTMLSourceElement", + "HTMLSpanElement", + "HTMLStyleElement", + "HTMLTableCaptionElement", + "HTMLTableCellElement", + "HTMLTableColElement", + "HTMLTableDataCellElement", + "HTMLTableElement", + "HTMLTableHeaderCellElement", + "HTMLTimeElement", + "HTMLTitleElement", + "HTMLTableRowElement", + "HTMLTableSectionElement", + "HTMLTemplateElement", + "HTMLTextAreaElement", + "HTMLTrackElement", + "HTMLUListElement", + "HTMLUnknownElement", + "HTMLVideoElement", + "StyleSheet", + "MediaList", + "CSSStyleSheet", + "CSSRule", + "CSSStyleRule", + "CSSMediaRule", + "CSSImportRule", + "CSSStyleDeclaration", + "StyleSheetList", + "XPathException", + "XPathExpression", + "XPathResult", + "XPathEvaluator", + "HTMLCollection", + "NodeFilter", + "NodeIterator", + "NodeList", + "XMLHttpRequestEventTarget", + "XMLHttpRequestUpload", + "DOMTokenList", + "URL", + "Window", + "_core", + "_globalProxy", + "__timers", + "_top", + "_parent", + "_frameElement", + "_document", + "_sessionHistory", + "_currentSessionHistoryEntryIndex", + "_length", + "_virtualConsole", + "length", + "window", + "frameElement", + "frames", + "self", + "parent", + "top", + "document", + "location", + "history", + "navigator", + "addEventListener", + "removeEventListener", + "dispatchEvent", + "setTimeout", + "setInterval", + "clearInterval", + "clearTimeout", + "__stopAllTimers", + "Image", + "Audio", + "postMessage", + "atob", + "btoa", + "FileReader", + "XMLHttpRequest", + "ArrayBuffer", + "Int8Array", + "Uint8Array", + "Uint8ClampedArray", + "Int16Array", + "Uint16Array", + "Int32Array", + "Uint32Array", + "Float32Array", + "Float64Array", + "stop", + "close", + "getComputedStyle", + "console", + "name", + "innerWidth", + "innerHeight", + "outerWidth", + "outerHeight", + "pageXOffset", + "pageYOffset", + "screenX", + "screenY", + "screenLeft", + "screenTop", + "scrollX", + "scrollY", + "scrollTop", + "scrollLeft", + "screen", + "alert", + "blur", + "confirm", + "createPopup", + "focus", + "moveBy", + "moveTo", + "open", + "print", + "prompt", + "resizeBy", + "resizeTo", + "scroll", + "scrollBy", + "scrollTo", + "toString" +] diff --git a/test/window properties should be as expected.js b/test/window properties should be as expected.js new file mode 100644 index 0000000..6533a47 --- /dev/null +++ b/test/window properties should be as expected.js @@ -0,0 +1,9 @@ +import test from 'ava'; +import expectedProperties from './fixtures/expectedProperties'; +import browserEnv from '../src'; + +test(t => { + browserEnv(); + const properties = Object.getOwnPropertyNames(window); + t.deepEqual(properties, expectedProperties); +});