Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aswitalski/dom-test
A subset of DOM Level 4 for tests in Node.js
https://github.com/aswitalski/dom-test
dom node test
Last synced: about 1 month ago
JSON representation
A subset of DOM Level 4 for tests in Node.js
- Host: GitHub
- URL: https://github.com/aswitalski/dom-test
- Owner: aswitalski
- License: mit
- Created: 2017-02-25T00:41:44.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-11-04T18:53:56.000Z (about 6 years ago)
- Last Synced: 2024-12-05T20:35:37.750Z (about 2 months ago)
- Topics: dom, node, test
- Language: JavaScript
- Size: 60.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dom-test
A subset of DOM Level 4 model for tests in Node.js[![Build Status](https://travis-ci.org/aswitalski/dom-test.svg?branch=master)](https://travis-ci.org/aswitalski/dom-test)
[![Coverage Status](https://coveralls.io/repos/github/aswitalski/dom-test/badge.svg)](https://coveralls.io/github/aswitalski/dom-test)
[![npm version](https://img.shields.io/npm/v/dom-test.svg?style=flat)](https://www.npmjs.com/package/dom-test)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 |