mockbot-node
mock html dom node
Installation
$ npm init
$ npm install mockbot-node --save
Modules
- mockbot-node
Module
- mockbot-node-factory
Factory module
mockbot-node
Module
Properties
Name | Type | Description |
---|---|---|
childNodes | Array |
an array of child nodes |
boolean
mockbot-node.hasChildNodes() ⇒ mock node.hasChildNodes
Kind: instance method of mockbot-node
Example (usage)
ifnode ...
mockbot-node
mockbot-node.appendChild(deep) ⇒ mock node.appenChild
Kind: instance method of mockbot-node
Param | Type | Description |
---|---|---|
deep | boolean |
If true, clone children as well |
Example (usage)
node;
mockbot-node
mockbot-node.cloneNode(deep) ⇒ mock node.cloneNode
Kind: instance method of mockbot-node
Param | Type | Description |
---|---|---|
deep | boolean |
If true, clone children as well |
Example (usage)
var n = el;
mockbot-node-factory
Factory module
mockbot-node
mockbot-node-factory.create(spec) ⇒ Factory method It takes one spec parameter that must be an object with named parameters
Kind: static method of mockbot-node-factory
Param | Type | Description |
---|---|---|
spec | Object |
Named parameters object |
spec.nodeType | number |
required node type |
Example (Usage example)
var factory = ;var obj = factory;
Testing
To test, go to the root folder and type (sans $):
$ npm test
Repo(s)
Contributing
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.
Version History
Version 0.1.2
- fixed download badge url in readme
Version 0.1.1
- added test coverage for cloneNode
Version 0.1.0
- initial release