Skip to content

aswitalski/dom-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dom-test

A subset of DOM Level 4 model for tests in Node.js

Build Status Coverage Status npm version

A lightweight library for testing DOM structures in isolation. Implemented methods and properties are specified below:

Global document object:

HTMLDocument
document.createAttribute
document.createComment
document.createElement
document.createTextNode

Node types:

Element
addEventListener
appendChild
attributes
childElementCount
children
classList
className
contains
dataset
firstChild
firstElementChild
getAttribute
hasChildNodes
insertBefore
lastChild
lastElementChild
nodeName
nodeType
parentElement
parentNode
remove
removeAttribute
removeEventListener
setAttribute
style
replaceChild
removeChild
tagName
Comment
nodeName
nodeType
parentElement
parentNode
remove
textContent
Text
nodeName
nodeType
parentElement
parentNode
remove
textContent

Element child nodes:

NodeList
entries
forEach
keys
length
values
( get node by index )
( iterate )

Element children:

HTMLCollection
item
length
( get element by index )

Element style:

CSSStyleDeclaration
getPropertyValue
item
length
removeProperty
setProperty
( get style by index )

Element class list:

DOMTokenList
add
contains
forEach
keys
length
remove
toggle
values
( iterate )
( get token by index )

Element dataset:

DOMStringMap
( get property by name )
( set property by name )

Element attributes:

NamedNodeMap
getNamedItem
removeNamedItem
setNamedItem
item
length
( get attribute by name )
( get attribute by index )

Attribute instance:

Attr
name
value

About

A subset of DOM Level 4 for tests in Node.js

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published