static Fakes

Static class to create various fake objects.

Methods

attr(String name, Object value) => Attr

Creates a fake implementation of an Attr.

name

String

Name of the attribute.

[value]

Object

Value of the attribute.

String name

Name of the attribute.

Object [value]

Value of the attribute.

return Attr

A fake object mimicking an Attr.

nodeList(Array data) => NodeList

Creates a fake implementation of a NodeList.

data

Array

Array that represents the data in the NodeList.

Array data

Array that represents the data in the NodeList.

return NodeList

A fake object mimicking a NodeList.

ofType(Function ctor) => Object

Creates a fake of the given constructor. The fake object's proto link will simply point to the constructor's prototype.

ctor

Function

The constructor of the object to create a fake of.

Function ctor

The constructor of the object to create a fake of.

return Object

The fake object.