Test.ObjectAssert Class
yui3/src/test/js/ObjectAssert.js:2
The ObjectAssert object provides functions to test JavaScript objects for a variety of cases.
Index
Methods
- areEqual static deprecated
- hasKey static deprecated
- hasKeys static deprecated
- inheritsKey static
- inheritsKeys static
- ownsKey static
- ownsKeys static
- ownsNoKeys static
- ownsOrInheritsKey static
- ownsOrInheritsKeys static
Methods
areEqual
-
expected
-
actual
-
message
Asserts that an object has all of the same properties and property values as the other.
Parameters:
-
expected
ObjectThe object with all expected properties and values.
-
actual
ObjectThe object to inspect.
-
message
String(Optional) The message to display if the assertion fails.
hasKey
-
propertyName
-
object
-
message
Asserts that an object has a property with the given name.
Parameters:
-
propertyName
StringThe name of the property to test.
-
object
ObjectThe object to search.
-
message
String(Optional) The message to display if the assertion fails.
hasKeys
-
properties
-
object
-
message
Asserts that an object has all properties of a reference object.
Parameters:
-
properties
ArrayAn array of property names that should be on the object.
-
object
ObjectThe object to search.
-
message
String(Optional) The message to display if the assertion fails.
inheritsKey
-
propertyName
-
object
-
message
Asserts that a property with the given name exists on an object's prototype.
Parameters:
-
propertyName
StringThe name of the property to test.
-
object
ObjectThe object to search.
-
message
String(Optional) The message to display if the assertion fails.
inheritsKeys
-
properties
-
object
-
message
Asserts that all properties exist on an object prototype.
Parameters:
-
properties
ArrayAn array of property names that should be on the object.
-
object
ObjectThe object to search.
-
message
String(Optional) The message to display if the assertion fails.
ownsKey
-
propertyName
-
object
-
message
Asserts that a property with the given name exists on an object instance (not on its prototype).
Parameters:
-
propertyName
StringThe name of the property to test.
-
object
ObjectThe object to search.
-
message
String(Optional) The message to display if the assertion fails.
ownsKeys
-
properties
-
object
-
message
Asserts that all properties exist on an object instance (not on its prototype).
Parameters:
-
properties
ArrayAn array of property names that should be on the object.
-
object
ObjectThe object to search.
-
message
String(Optional) The message to display if the assertion fails.
ownsNoKeys
-
object
-
message
Asserts that an object owns no properties.
Parameters:
-
object
ObjectThe object to check.
-
message
String(Optional) The message to display if the assertion fails.
ownsOrInheritsKey
-
propertyName
-
object
-
message
Asserts that an object has a property with the given name.
Parameters:
-
propertyName
StringThe name of the property to test.
-
object
ObjectThe object to search.
-
message
String(Optional) The message to display if the assertion fails.
ownsOrInheritsKeys
-
properties
-
object
-
message
Asserts that an object has all properties of a reference object.
Parameters:
-
properties
ArrayAn array of property names that should be on the object.
-
object
ObjectThe object to search.
-
message
String(Optional) The message to display if the assertion fails.