Assert presence of a native property on the global object... |
hasNative( key, message ); |
Parameter | Type | Mandatory | Notes | API Version |
---|---|---|---|---|
key | String | The name of the property to inspect. | 1.0 | |
message | String | (<v1.4) (v1.4+) | A message stating what the assertion is testing. As of v1.4, message defaults to: | 1.0 1.4 |
Value | Type | Notes | API Version |
---|---|---|---|
<error> | Error | Most likely the parameters are wrong. | 1.0 |
true | Boolean | The key is defined on the global object. | 1.0 |
false | Boolean | The key is missing from the global object. | 1.0 |
Test("Native checks", Test.ANY( ), function() { // assertion will pass hasNative( "Math", "Math exists?" ); // assertion will fail (case-sensitive) hasNative( "math", "math exists?" ); }); |