YUI recommends YUI3.

YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.

This documentation is no longer maintained.

Yahoo! UI Library

yuitest  2.9.0

Yahoo! UI Library > yuitest > YAHOO.util.ObjectAssert

static Class YAHOO.util.ObjectAssert

The ObjectAssert object provides functions to test JavaScript objects for a variety of cases.



static void hasProperty ( propertyName , object , message )
Asserts that an object has a property with the given name.
propertyName <String> The name of the property to test.
object <Object> The object to search.
message <String> (Optional) The message to display if the assertion fails.


static void propertiesAreEqual ( expected , actual , message )
Asserts that all properties in the object exist in another object.
expected <Object> An object with the expected properties.
actual <Object> An object with the actual properties.
message <String> (Optional) The message to display if the assertion fails.

Copyright © 2011 Yahoo! Inc. All rights reserved.