Child pages
  • JSUnit

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
{hidden} DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden} {sub-section:description|text=}{sub-section}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}void{td}{td}[#assertEquals]\(message, expected, actual) Asserts that two values are equal.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertFalse]\(message, boolean_condition) Asserts that a condition is false.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertFloatEquals]\(message, expectedFloat, actualFloat, tolerance) Asserts that two floating point values are equal to within a given tolerance.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertMatches]\(message, regularExpression, actualString) Asserts that a regular expression matches a string.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNotNull]\(message, object) Asserts that an object is not null.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNotSame]\(message, notExpected, actual) Asserts that two values are not the same.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNotUndefined]\(message, definedObject) Asserts that an object is not undefined.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertNull]\(message, nullValue) Asserts that an object is null.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertSame]\(message, expected, actual) Asserts that two values are the same.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertTrue]\(message, boolean_condition) Asserts that a condition is true.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#assertUndefined]\(message, undefinedValue) Asserts that an object is undefined.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#fail]\(message, instanceOfCallStack, userMessage) Fails a test.{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=6267E5CB-AF12-4AC7-ACE9-9A2FF14EEE1E}{tr:id=name}{td}h6.assertEquals{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertEquals{span}{span:id=iets|style=float: left;}\(message, expected, actual){span}{td}{tr}{tr:id=des}{td}{sub-section:6267E5CB-AF12-4AC7-ACE9-9A2FF14EEE1E_des|text=|trigger=button}{sub-section}{sub-section:6267E5CB-AF12-4AC7-ACE9-9A2FF14EEE1E_des|trigger=none|class=sIndent}Asserts that two values are equal. AssertionFailedError is thrown if the actual value does not match the regular expression.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:6267E5CB-AF12-4AC7-ACE9-9A2FF14EEE1E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6267E5CB-AF12-4AC7-ACE9-9A2FF14EEE1E_prs|trigger=none}\[message\] -- The test description/message. expected -- the expected value. actual -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:6267E5CB-AF12-4AC7-ACE9-9A2FF14EEE1E_ret|text=|trigger=button}{sub-section}{sub-section:6267E5CB-AF12-4AC7-ACE9-9A2FF14EEE1E_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6267E5CB-AF12-4AC7-ACE9-9A2FF14EEE1E_see|text=|trigger=button}{sub-section}{sub-section:6267E5CB-AF12-4AC7-ACE9-9A2FF14EEE1E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6267E5CB-AF12-4AC7-ACE9-9A2FF14EEE1E_see|text=|trigger=button}{sub-section}{sub-section:6267E5CB-AF12-4AC7-ACE9-9A2FF14EEE1E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6267E5CB-AF12-4AC7-ACE9-9A2FF14EEE1E_sam|text=|trigger=button}{sub-section}{sub-section:6267E5CB-AF12-4AC7-ACE9-9A2FF14EEE1E_sam|class=sIndent|trigger=none}{code:language=javascript} // Asserts that two values are equal. AssertionFailedError is thrown if the actual value does not match the regular expression. jsunit.assertEquals("Solution name test", "someSolution", application.getSolutionName()); jsunit.assertEquals("Simple math test", 2, 1 + 1); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=887C9EF4-6C5C-48FE-BDF3-BB1B3F25159D}{tr:id=name}{td}h6.assertFalse{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertFalse{span}{span:id=iets|style=float: left;}\(message, boolean_condition){span}{td}{tr}{tr:id=des}{td}{sub-section:887C9EF4-6C5C-48FE-BDF3-BB1B3F25159D_des|text=|trigger=button}{sub-section}{sub-section:887C9EF4-6C5C-48FE-BDF3-BB1B3F25159D_des|trigger=none|class=sIndent}Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:887C9EF4-6C5C-48FE-BDF3-BB1B3F25159D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:887C9EF4-6C5C-48FE-BDF3-BB1B3F25159D_prs|trigger=none}\[message\] -- The test description/message. boolean_condition -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:887C9EF4-6C5C-48FE-BDF3-BB1B3F25159D_ret|text=|trigger=button}{sub-section}{sub-section:887C9EF4-6C5C-48FE-BDF3-BB1B3F25159D_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:887C9EF4-6C5C-48FE-BDF3-BB1B3F25159D_see|text=|trigger=button}{sub-section}{sub-section:887C9EF4-6C5C-48FE-BDF3-BB1B3F25159D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:887C9EF4-6C5C-48FE-BDF3-BB1B3F25159D_see|text=|trigger=button}{sub-section}{sub-section:887C9EF4-6C5C-48FE-BDF3-BB1B3F25159D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:887C9EF4-6C5C-48FE-BDF3-BB1B3F25159D_sam|text=|trigger=button}{sub-section}{sub-section:887C9EF4-6C5C-48FE-BDF3-BB1B3F25159D_sam|class=sIndent|trigger=none}{code:language=javascript} // Asserts that a condition is false
Wiki Markup
Div
styledisplay:none

DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.

Div
iddescription

See Unit Testing for more info on how to utilize the methods of the JSUnit class.

 



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertEquals(expected, actual)
Asserts that two values are equal.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertEquals(message, expected, actual)
Asserts that two values are equal.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertFalse(boolean_condition)
Asserts that a condition is false.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertFalse(message, boolean_condition)
Asserts that a condition is false.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertFloatEquals(expectedFloat, actualFloat, tolerance)
Asserts that two floating point values are equal to within a given tolerance.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertFloatEquals(message, expectedFloat, actualFloat, tolerance)
Asserts that two floating point values are equal to within a given tolerance.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertMatches(regularExpression, actualString)
Asserts that a regular expression matches a string.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertMatches(message, regularExpression, actualString)
Asserts that a regular expression matches a string.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertNotNull(object)
Asserts that an object is not null.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertNotNull(message, object)
Asserts that an object is not null.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertNotSame(notExpected, actual)
Asserts that two values are not the same.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertNotSame(message, notExpected, actual)
Asserts that two values are not the same.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertNotUndefined(definedObject)
Asserts that an object is not undefined.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertNotUndefined(message, definedObject)
Asserts that an object is not undefined.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertNull(nullValue)
Asserts that an object is null.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertNull(message, nullValue)
Asserts that an object is null.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertSame(expected, actual)
Asserts that two values are the same.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertSame(message, expected, actual)
Asserts that two values are the same.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertTrue(boolean_condition)
Asserts that a condition is true.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertTrue(message, boolean_condition)
Asserts that a condition is true.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertUndefined(undefinedValue)
Asserts that an object is undefined.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
assertUndefined(message, undefinedValue)
Asserts that an object is undefined.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
fail(message)
Fails a test.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
fail(message, instanceOfCallStack)
Fails a test.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
fail(message, instanceOfCallStack, userMessage)
Fails a test.



HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idassertEquals-Object_Object
Table Row (tr)
idname
Table Cell (td)

assertEquals

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertEquals
Span
(expected, actual)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that two values are equal. AssertionFailedError is thrown if the actual value does not match the regular expression.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} expected - the expected value.
{Object} actual - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that two values are equal. AssertionFailedError is thrown if the actual value does not match the regular expression.
jsunit.assertEquals("Solution name test", "someSolution", application.getSolutionName());
jsunit.assertEquals("Simple math test", 2, 1 + 1);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertEquals-String_Object_Object
Table Row (tr)
idname
Table Cell (td)

assertEquals

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertEquals
Span
(message, expected, actual)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that two values are equal. AssertionFailedError is thrown if the actual value does not match the regular expression.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message.
{Object} expected - the expected value.
{Object} actual - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that two values are equal. AssertionFailedError is thrown if the actual value does not match the regular expression.
jsunit.assertEquals("Solution name test", "someSolution", application.getSolutionName());
jsunit.assertEquals("Simple math test", 2, 1 + 1);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertFalse-Boolean
Table Row (tr)
idname
Table Cell (td)

assertFalse

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertFalse
Span
(boolean_condition)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} boolean_condition - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.
jsunit.assertFalse("False test", application.isLastPrintPreviewPrinted());
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertFalse-String_Boolean
Table Row (tr)
idname
Table Cell (td)

assertFalse

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertFalse
Span
(message, boolean_condition)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message.
{Boolean} boolean_condition - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that a condition is false. AssertionFailedError is thrown if the evaluation was not false.
jsunit.assertFalse("False test", application.isLastPrintPreviewPrinted());
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertFloatEquals-Number_Number_Number
Table Row (tr)
idname
Table Cell (td)

assertFloatEquals

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertFloatEquals
Span
(expectedFloat, actualFloat, tolerance)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that two floating point values are equal to within a given tolerance. AssertionFailedError is thrown if the expected value is not within the tolerance of the actual one.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Number} expectedFloat - the expected value.
{Number} actualFloat - the actual value.
{Number} tolerance - tolerance when comparing.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that two floating point values are equal to within a given tolerance. AssertionFailedError is thrown if the expected 
evaluation
value 
was
is not 
false. jsunit.assertFalse("False test", application.isLastPrintPreviewPrinted()); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=15DB9810-A50D-4F4C-B681-1B040A5FC077}{tr:id=name}{td}h6.assertFloatEquals{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertFloatEquals{span}{span:id=iets|style=float: left;}\(message, expectedFloat, actualFloat, tolerance){span}{td}{tr}{tr:id=des}{td}{sub-section:15DB9810-A50D-4F4C-B681-1B040A5FC077_des|text=|trigger=button}{sub-section}{sub-section:15DB9810-A50D-4F4C-B681-1B040A5FC077_des|trigger=none|class=sIndent}Asserts that two floating point values are equal to within a given tolerance. AssertionFailedError is thrown if the expected value is not within the tolerance of the actual one.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:15DB9810-A50D-4F4C-B681-1B040A5FC077_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:15DB9810-A50D-4F4C-B681-1B040A5FC077_prs|trigger=none}\[message\] -- The test description/message. expectedFloat -- the expected value. actualFloat -- the actual value. tolerance -- float tolerance when comparing. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:15DB9810-A50D-4F4C-B681-1B040A5FC077_ret|text=|trigger=button}{sub-section}{sub-section:15DB9810-A50D-4F4C-B681-1B040A5FC077_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:15DB9810-A50D-4F4C-B681-1B040A5FC077_see|text=|trigger=button}{sub-section}{sub-section:15DB9810-A50D-4F4C-B681-1B040A5FC077_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:15DB9810-A50D-4F4C-B681-1B040A5FC077_see|text=|trigger=button}{sub-section}{sub-section:15DB9810-A50D-4F4C-B681-1B040A5FC077_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:15DB9810-A50D-4F4C-B681-1B040A5FC077_sam|text=|trigger=button}{sub-section}{sub-section:15DB9810-A50D-4F4C-B681-1B040A5FC077_sam|class=sIndent|trigger=none}{code:language=javascript} // Asserts that two floating point values are equal to within a given tolerance. AssertionFailedError is thrown if the expected value is not within the tolerance of the actual one. jsunit.assertFloatEquals("Float equals test", 3.12, 3.121, 0.0015); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=448D8FF1-B127-4479-A181-87B980143244}{tr:id=name}{td}h6.assertMatches{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertMatches{span}{span:id=iets|style=float: left;}\(message, regularExpression, actualString){span}{td}{tr}{tr:id=des}{td}{sub-section:448D8FF1-B127-4479-A181-87B980143244_des|text=|trigger=button}{sub-section}{sub-section:448D8FF1-B127-4479-A181-87B980143244_des|trigger=none|class=sIndent}Asserts that a regular expression matches a string. AssertionFailedError is thrown if the expected value is not the actual one.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:448D8FF1-B127-4479-A181-87B980143244_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:448D8FF1-B127-4479-A181-87B980143244_prs|trigger=none}\[message\] -- The test description/message. regularExpression -- the regular expression used for matching. actualString -- the actual value to be matched. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:448D8FF1-B127-4479-A181-87B980143244_ret|text=|trigger=button}{sub-section}{sub-section:448D8FF1-B127-4479-A181-87B980143244_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:448D8FF1-B127-4479-A181-87B980143244_see|text=|trigger=button}{sub-section}{sub-section:448D8FF1-B127-4479-A181-87B980143244_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:448D8FF1-B127-4479-A181-87B980143244_see|text=|trigger=button}{sub-section}{sub-section:448D8FF1-B127-4479-A181-87B980143244_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:448D8FF1-B127-4479-A181-87B980143244_sam|text=|trigger=button}{sub-section}{sub-section:448D8FF1-B127-4479-A181-87B980143244_sam|class=sIndent|trigger=none}{code:language=javascript} // Asserts that a regular expression matches a string
within the tolerance of the actual one.
jsunit.assertFloatEquals("Float equals test", 3.12, 3.121, 0.0015);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertFloatEquals-String_Number_Number_Number
Table Row (tr)
idname
Table Cell (td)

assertFloatEquals

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertFloatEquals
Span
(message, expectedFloat, actualFloat, tolerance)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that two floating point values are equal to within a given tolerance. AssertionFailedError is thrown if the expected value is not within the tolerance of the actual one.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message.
{Number} expectedFloat - the expected value.
{Number} actualFloat - the actual value.
{Number} tolerance - tolerance when comparing.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that two floating point values are equal to within a given tolerance. AssertionFailedError is thrown if the expected value is not within the tolerance of the actual one.
jsunit.assertFloatEquals("Float equals test", 3.12, 3.121, 0.0015);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertMatches-Object_String
Table Row (tr)
idname
Table Cell (td)

assertMatches

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertMatches
Span
(regularExpression, actualString)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that a regular expression matches a string. AssertionFailedError is thrown if the expected value is not the actual one.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} regularExpression - the regular expression used for matching.
{String} actualString - the actual value to be matched.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that a regular expression matches a string. AssertionFailedError is thrown if the expected value is not the actual one.
jsunit.assertMatches(new RegExp("gr(a|e)y"), "gray");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertMatches-String_Object_String
Table Row (tr)
idname
Table Cell (td)

assertMatches

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertMatches
Span
(message, regularExpression, actualString)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that a regular expression matches a string. AssertionFailedError is thrown if the expected value is not the actual one.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message.
{Object} regularExpression - the regular expression used for matching.
{String} actualString - the actual value to be matched.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that a regular expression matches a string. AssertionFailedError is thrown if the expected value is not the actual one.
jsunit.assertMatches("Match test", new RegExp("gr(a|e)y"), "gray");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertNotNull-Object
Table Row (tr)
idname
Table Cell (td)

assertNotNull

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertNotNull
Span
(object)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that an object is not null. AssertionFailedError is thrown if the object is not null.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} object - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that an object is not null. AssertionFailedError is thrown if the 
expected value
object is not
the actual one. jsunit.assertMatches("Match test", new RegExp("gr(a|e)y"), "gray"); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=152E22B6-F65C-4AC9-BF19-3D6443E6024A}{tr:id=name}{td}h6.assertNotNull{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNotNull{span}{span:id=iets|style=float: left;}\(message, object){span}{td}{tr}{tr:id=des}{td}{sub-section:152E22B6-F65C-4AC9-BF19-3D6443E6024A_des|text=|trigger=button}{sub-section}{sub-section:152E22B6-F65C-4AC9-BF19-3D6443E6024A_des|trigger=none|class=sIndent}Asserts that an object is not null. AssertionFailedError is thrown if the object is not null.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:152E22B6-F65C-4AC9-BF19-3D6443E6024A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:152E22B6-F65C-4AC9-BF19-3D6443E6024A_prs|trigger=none}\[message\] -- The test description/message. object -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:152E22B6-F65C-4AC9-BF19-3D6443E6024A_ret|text=|trigger=button}{sub-section}{sub-section:152E22B6-F65C-4AC9-BF19-3D6443E6024A_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:152E22B6-F65C-4AC9-BF19-3D6443E6024A_see|text=|trigger=button}{sub-section}{sub-section:152E22B6-F65C-4AC9-BF19-3D6443E6024A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:152E22B6-F65C-4AC9-BF19-3D6443E6024A_see|text=|trigger=button}{sub-section}{sub-section:152E22B6-F65C-4AC9-BF19-3D6443E6024A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:152E22B6-F65C-4AC9-BF19-3D6443E6024A_sam|text=|trigger=button}{sub-section}{sub-section:152E22B6-F65C-4AC9-BF19-3D6443E6024A_sam|class=sIndent|trigger=none}{code:language=javascript} // Asserts that an object is not null. AssertionFailedError is thrown if the object is not null. var a; // this is undefined, not null jsunit.assertNotNull("Not null test", a); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=BF87E726-2A2D-4E55-B369-8809EE15F8A9}{tr:id=name}{td}h6.assertNotSame{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNotSame{span}{span:id=iets|style=float: left;}\(message, notExpected, actual){span}{td}{tr}{tr:id=des}{td}{sub-section:BF87E726-2A2D-4E55-B369-8809EE15F8A9_des|text=|trigger=button}{sub-section}{sub-section:BF87E726-2A2D-4E55-B369-8809EE15F8A9_des|trigger=none|class=sIndent}Asserts that two values are not the same. AssertionFailedError is thrown if the expected value is the actual one.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:BF87E726-2A2D-4E55-B369-8809EE15F8A9_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:BF87E726-2A2D-4E55-B369-8809EE15F8A9_prs|trigger=none}\[message\] -- The test description/message. notExpected -- the value that is not expected. actual -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:BF87E726-2A2D-4E55-B369-8809EE15F8A9_ret|text=|trigger=button}{sub-section}{sub-section:BF87E726-2A2D-4E55-B369-8809EE15F8A9_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:BF87E726-2A2D-4E55-B369-8809EE15F8A9_see|text=|trigger=button}{sub-section}{sub-section:BF87E726-2A2D-4E55-B369-8809EE15F8A9_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:BF87E726-2A2D-4E55-B369-8809EE15F8A9_see|text=|trigger=button}{sub-section}{sub-section:BF87E726-2A2D-4E55-B369-8809EE15F8A9_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:BF87E726-2A2D-4E55-B369-8809EE15F8A9_sam|text=|trigger=button}{sub-section}{sub-section:BF87E726-2A2D-4E55-B369-8809EE15F8A9_sam|class=sIndent|trigger=none}{code:language=javascript} // Asserts that two values are not the same. AssertionFailedError is thrown if the expected value is the actual one. var a = new Date(1990, 1, 1); var b = new Date(1990, 1, 1); jsunit.assertNotSame("Not same test", a, b); jsunit.assertEquals("But equals", a, b); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=21CF6A67-879A-4FC7-AB46-87EB29FC4E3D}{tr:id=name}{td}h6.assertNotUndefined{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNotUndefined{span}{span:id=iets|style=float: left;}\(message, definedObject){span}{td}{tr}{tr:id=des}{td}{sub-section:21CF6A67-879A-4FC7-AB46-87EB29FC4E3D_des|text=|trigger=button}{sub-section}{sub-section:21CF6A67-879A-4FC7-AB46-87EB29FC4E3D_des|trigger=none|class=sIndent}Asserts that an object is not undefined. AssertionFailedError is thrown if the object is undefined.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:21CF6A67-879A-4FC7-AB46-87EB29FC4E3D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:21CF6A67-879A-4FC7-AB46-87EB29FC4E3D_prs|trigger=none}\[message\] -- The test description/message. definedObject -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:21CF6A67-879A-4FC7-AB46-87EB29FC4E3D_ret|text=|trigger=button}{sub-section}{sub-section:21CF6A67-879A-4FC7-AB46-87EB29FC4E3D_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:21CF6A67-879A-4FC7-AB46-87EB29FC4E3D_see|text=|trigger=button}{sub-section}{sub-section:21CF6A67-879A-4FC7-AB46-87EB29FC4E3D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:21CF6A67-879A-4FC7-AB46-87EB29FC4E3D_see|text=|trigger=button}{sub-section}{sub-section:21CF6A67-879A-4FC7-AB46-87EB29FC4E3D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:21CF6A67-879A-4FC7-AB46-87EB29FC4E3D_sam|text=|trigger=button}{sub-section}{sub-section:21CF6A67-879A-4FC7-AB46-87EB29FC4E3D_sam|class=sIndent|trigger=none}{code:language=javascript} // Asserts that an object is not undefined
 null.
var a; // this is undefined, not null
jsunit.assertNotNull(a);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertNotNull-String_Object
Table Row (tr)
idname
Table Cell (td)

assertNotNull

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertNotNull
Span
(message, object)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that an object is not null. AssertionFailedError is thrown if the object is not null.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message.
{Object} object - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that an object is not null. AssertionFailedError is thrown if the object is not null.
var a; // this is undefined, not null
jsunit.assertNotNull("Not null test", a);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertNotSame-Object_Object
Table Row (tr)
idname
Table Cell (td)

assertNotSame

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertNotSame
Span
(notExpected, actual)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that two values are not the same. AssertionFailedError is thrown if the expected value is the actual one.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} notExpected - the value that is not expected.
{Object} actual - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that two values are not the same. AssertionFailedError is thrown if the expected value is the actual one.
var a = new Date(1990, 1, 1);
var b = new Date(1990, 1, 1);
jsunit.assertNotSame(a, b);
jsunit.assertEquals("But equals", a, b);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertNotSame-String_Object_Object
Table Row (tr)
idname
Table Cell (td)

assertNotSame

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertNotSame
Span
(message, notExpected, actual)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that two values are not the same. AssertionFailedError is thrown if the expected value is the actual one.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message.
{Object} notExpected - the value that is not expected.
{Object} actual - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that two values are not the same. AssertionFailedError is thrown if the expected value is the actual one.
var a = new Date(1990, 1, 1);
var b = new Date(1990, 1, 1);
jsunit.assertNotSame("Not same test", a, b);
jsunit.assertEquals("But equals", a, b);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertNotUndefined-Object
Table Row (tr)
idname
Table Cell (td)

assertNotUndefined

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertNotUndefined
Span
(definedObject)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that an object is not undefined. AssertionFailedError is thrown if the object is undefined.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} definedObject - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that an object is not undefined. AssertionFailedError is thrown if the object is undefined.
var a = 0;
jsunit.assertNotUndefined(a);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertNotUndefined-String_Object
Table Row (tr)
idname
Table Cell (td)

assertNotUndefined

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertNotUndefined
Span
(message, definedObject)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that an object is not undefined. AssertionFailedError is thrown if the object is undefined.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message.
{Object} definedObject - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that an object is not undefined. AssertionFailedError is thrown if the object is undefined.
var a = 0;
jsunit.assertNotUndefined("Not undefined test", a);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertNull-Object
Table Row (tr)
idname
Table Cell (td)

assertNull

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertNull
Span
(nullValue)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that an object is null. AssertionFailedError is thrown if the object is not null.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} nullValue - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that an object is null. AssertionFailedError is thrown if the object is not null.
jsunit.assertNull("Null test", null);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertNull-String_Object
Table Row (tr)
idname
Table Cell (td)

assertNull

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertNull
Span
(message, nullValue)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that an object is null. AssertionFailedError is thrown if the object is not null.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message.
{Object} nullValue - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that an object is null. AssertionFailedError is thrown if the object is not null.
jsunit.assertNull("Null test", null);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertSame-Object_Object
Table Row (tr)
idname
Table Cell (td)

assertSame

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertSame
Span
(expected, actual)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that two values are the same. AssertionFailedError is thrown if the expected value is not the actual one.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} expected - the expected value.
{Object} actual - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that two values are the same. AssertionFailedError is thrown if the expected 
object
value is
undefined
 not the actual one.
var a = new Date(1990, 1, 1);
var b = 
0
a;
jsunit.
assertNotUndefined("Not undefined test"
assertSame(a, 
a
b);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=162E0F16-F240-4A4D-83F3-E441C8F408CE}{tr:id=name}{td}h6.assertNull{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertNull{span}{span:id=iets|style=float: left;}\(message, nullValue){span}{td}{tr}{tr:id=des}{td}{sub-section:162E0F16-F240-4A4D-83F3-E441C8F408CE_des|text=|trigger=button}{sub-section}{sub-section:162E0F16-F240-4A4D-83F3-E441C8F408CE_des|trigger=none|class=sIndent}Asserts that an object is null. AssertionFailedError is thrown if the object is not null.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:162E0F16-F240-4A4D-83F3-E441C8F408CE_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:162E0F16-F240-4A4D-83F3-E441C8F408CE_prs|trigger=none}\[message\] -- The test description/message. nullValue -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:162E0F16-F240-4A4D-83F3-E441C8F408CE_ret|text=|trigger=button}{sub-section}{sub-section:162E0F16-F240-4A4D-83F3-E441C8F408CE_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:162E0F16-F240-4A4D-83F3-E441C8F408CE_see|text=|trigger=button}{sub-section}{sub-section:162E0F16-F240-4A4D-83F3-E441C8F408CE_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:162E0F16-F240-4A4D-83F3-E441C8F408CE_see|text=|trigger=button}{sub-section}{sub-section:162E0F16-F240-4A4D-83F3-E441C8F408CE_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:162E0F16-F240-4A4D-83F3-E441C8F408CE_sam|text=|trigger=button}{sub-section}{sub-section:162E0F16-F240-4A4D-83F3-E441C8F408CE_sam|class=sIndent|trigger=none}{code:language=javascript} // Asserts that an object is null
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertSame-String_Object_Object
Table Row (tr)
idname
Table Cell (td)

assertSame

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertSame
Span
(message, expected, actual)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that two values are the same. AssertionFailedError is thrown if the expected value is not the actual one.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message.
{Object} expected - the expected value.
{Object} actual - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that two values are the same. AssertionFailedError is thrown if the expected value is not the actual one.
var a = new Date(1990, 1, 1);
var b = a;
jsunit.assertSame("Same test", a, b);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertTrue-Boolean
Table Row (tr)
idname
Table Cell (td)

assertTrue

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertTrue
Span
(boolean_condition)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that a condition is true. AssertionFailedError is thrown if the evaluation was not true.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Boolean} boolean_condition - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that a condition is true. AssertionFailedError is thrown if the evaluation was not true.
jsunit.assertTrue("True test", application.isLastPrintPreviewPrinted());
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertTrue-String_Boolean
Table Row (tr)
idname
Table Cell (td)

assertTrue

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertTrue
Span
(message, boolean_condition)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that a condition is true. AssertionFailedError is thrown if the evaluation was not true.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message.
{Boolean} boolean_condition - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that a condition is true. AssertionFailedError is thrown if the 
object
evaluation 
is
was not 
null
true.
jsunit.
assertNull
assertTrue("
Null
True test", 
null); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0B28FDB2-0440-4F24-81C3-0ECB33422358}{tr:id=name}{td}h6.assertSame{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertSame{span}{span:id=iets|style=float: left;}\(message, expected, actual){span}{td}{tr}{tr:id=des}{td}{sub-section:0B28FDB2-0440-4F24-81C3-0ECB33422358_des|text=|trigger=button}{sub-section}{sub-section:0B28FDB2-0440-4F24-81C3-0ECB33422358_des|trigger=none|class=sIndent}Asserts that two values are the same. AssertionFailedError is thrown if the expected value is not the actual one.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:0B28FDB2-0440-4F24-81C3-0ECB33422358_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0B28FDB2-0440-4F24-81C3-0ECB33422358_prs|trigger=none}\[message\] -- The test description/message. expected -- the expected value. actual -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:0B28FDB2-0440-4F24-81C3-0ECB33422358_ret|text=|trigger=button}{sub-section}{sub-section:0B28FDB2-0440-4F24-81C3-0ECB33422358_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0B28FDB2-0440-4F24-81C3-0ECB33422358_see|text=|trigger=button}{sub-section}{sub-section:0B28FDB2-0440-4F24-81C3-0ECB33422358_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0B28FDB2-0440-4F24-81C3-0ECB33422358_see|text=|trigger=button}{sub-section}{sub-section:0B28FDB2-0440-4F24-81C3-0ECB33422358_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0B28FDB2-0440-4F24-81C3-0ECB33422358_sam|text=|trigger=button}{sub-section}{sub-section:0B28FDB2-0440-4F24-81C3-0ECB33422358_sam|class=sIndent|trigger=none}{code:language=javascript} // Asserts that two values are the same. AssertionFailedError is thrown if the expected value is not the actual one. var a = new Date(1990, 1, 1); var b = a; jsunit.assertSame("Same test", a, b); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0EFB63B2-3224-424C-B88A-A11B97575D68}{tr:id=name}{td}h6.assertTrue{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertTrue{span}{span:id=iets|style=float: left;}\(message, boolean_condition){span}{td}{tr}{tr:id=des}{td}{sub-section:0EFB63B2-3224-424C-B88A-A11B97575D68_des|text=|trigger=button}{sub-section}{sub-section:0EFB63B2-3224-424C-B88A-A11B97575D68_des|trigger=none|class=sIndent}Asserts that a condition is true. AssertionFailedError is thrown if the evaluation was not true.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:0EFB63B2-3224-424C-B88A-A11B97575D68_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0EFB63B2-3224-424C-B88A-A11B97575D68_prs|trigger=none}\[message\] -- The test description/message. boolean_condition -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:0EFB63B2-3224-424C-B88A-A11B97575D68_ret|text=|trigger=button}{sub-section}{sub-section:0EFB63B2-3224-424C-B88A-A11B97575D68_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0EFB63B2-3224-424C-B88A-A11B97575D68_see|text=|trigger=button}{sub-section}{sub-section:0EFB63B2-3224-424C-B88A-A11B97575D68_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0EFB63B2-3224-424C-B88A-A11B97575D68_see|text=|trigger=button}{sub-section}{sub-section:0EFB63B2-3224-424C-B88A-A11B97575D68_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0EFB63B2-3224-424C-B88A-A11B97575D68_sam|text=|trigger=button}{sub-section}{sub-section:0EFB63B2-3224-424C-B88A-A11B97575D68_sam|class=sIndent|trigger=none}{code:language=javascript} // Asserts that a condition is true. AssertionFailedError is thrown if the evaluation was not true. jsunit.assertTrue("True test", application.isLastPrintPreviewPrinted()); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D99A7A79-5FE9-4F90-81E9-97A8FE313760}{tr:id=name}{td}h6.assertUndefined{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}assertUndefined{span}{span:id=iets|style=float: left;}\(message, undefinedValue){span}{td}{tr}{tr:id=des}{td}{sub-section:D99A7A79-5FE9-4F90-81E9-97A8FE313760_des|text=|trigger=button}{sub-section}{sub-section:D99A7A79-5FE9-4F90-81E9-97A8FE313760_des|trigger=none|class=sIndent}Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:D99A7A79-5FE9-4F90-81E9-97A8FE313760_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D99A7A79-5FE9-4F90-81E9-97A8FE313760_prs|trigger=none}\[message\] -- The test description/message. undefinedValue -- the actual value. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:D99A7A79-5FE9-4F90-81E9-97A8FE313760_ret|text=|trigger=button}{sub-section}{sub-section:D99A7A79-5FE9-4F90-81E9-97A8FE313760_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D99A7A79-5FE9-4F90-81E9-97A8FE313760_see|text=|trigger=button}{sub-section}{sub-section:D99A7A79-5FE9-4F90-81E9-97A8FE313760_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D99A7A79-5FE9-4F90-81E9-97A8FE313760_see|text=|trigger=button}{sub-section}{sub-section:D99A7A79-5FE9-4F90-81E9-97A8FE313760_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D99A7A79-5FE9-4F90-81E9-97A8FE313760_sam|text=|trigger=button}{sub-section}{sub-section:D99A7A79-5FE9-4F90-81E9-97A8FE313760_sam|class=sIndent|trigger=none}{code:language=javascript} // Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined. jsunit.assertUndefined("Undefined test", thisIsUndefined); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=57091445-772D-481C-938A-14309960310B}{tr:id=name}{td}h6.fail{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}fail{span}{span:id=iets|style=float: left;}\(message, instanceOfCallStack, userMessage){span}{td}{tr}{tr:id=des}{td}{sub-section:57091445-772D-481C-938A-14309960310B_des|text=|trigger=button}{sub-section}{sub-section:57091445-772D-481C-938A-14309960310B_des|trigger=none|class=sIndent}Fails a test. AssertionFailedError is always thrown.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:57091445-772D-481C-938A-14309960310B_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:57091445-772D-481C-938A-14309960310B_prs|trigger=none}\[message\] -- The test description/message. This is usually the only parameter specified when calling this method. \[instanceOfCallStack\] -- an internal JSUnit call stack. Use null for this if you want to get to the next optional parameter. Usually not specified. \[userMessage\] -- an user message. Usually not specified. {sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:57091445-772D-481C-938A-14309960310B_ret|text=|trigger=button}{sub-section}{sub-section:57091445-772D-481C-938A-14309960310B_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:57091445-772D-481C-938A-14309960310B_see|text=|trigger=button}{sub-section}{sub-section:57091445-772D-481C-938A-14309960310B_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:57091445-772D-481C-938A-14309960310B_see|text=|trigger=button}{sub-section}{sub-section:57091445-772D-481C-938A-14309960310B_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:57091445-772D-481C-938A-14309960310B_sam|text=|trigger=button}{sub-section}{sub-section:57091445-772D-481C-938A-14309960310B_sam|class=sIndent|trigger=none}{code:language=javascript}
application.isLastPrintPreviewPrinted());
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertUndefined-Object
Table Row (tr)
idname
Table Cell (td)

assertUndefined

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertUndefined
Span
(undefinedValue)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{Object} undefinedValue - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.
jsunit.assertUndefined("Undefined test", thisIsUndefined);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idassertUndefined-String_Object
Table Row (tr)
idname
Table Cell (td)

assertUndefined

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
assertUndefined
Span
(message, undefinedValue)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message.
{Object} undefinedValue - the actual value.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Asserts that an object is undefined. AssertionFailedError is thrown if the object is defined.
jsunit.assertUndefined(thisIsUndefined);
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idfail-String
Table Row (tr)
idname
Table Cell (td)

fail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
fail
Span
(message)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Fails a test. AssertionFailedError is always thrown.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message. This is usually the only parameter specified when calling this method.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Fails a test. AssertionFailedError is always thrown.
jsunit.fail("Fail test");
jsunit.fail("test", null, "Fail"); // 2nd param is not used in Servoy, params 3 and 1 get merged to form a message. The result is the same as in the line above.
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idfail-String_Object
Table Row (tr)
idname
Table Cell (td)

fail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
fail
Span
(message, instanceOfCallStack)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Fails a test. AssertionFailedError is always thrown.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message. This is usually the only parameter specified when calling this method.
{Object} instanceOfCallStack - an internal JSUnit call stack. Use null for this if you want to get to the next optional parameter. Usually not specified.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Fails a test. AssertionFailedError is always thrown.
jsunit.fail("Fail test");
jsunit.fail("test", null, "Fail"); // 2nd param is not used in Servoy, params 3 and 1 get merged to form a message. The result is the same as in the line above.
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idfail-String_Object_String
Table Row (tr)
idname
Table Cell (td)

fail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
fail
Span
(message, instanceOfCallStack, userMessage)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Fails a test. AssertionFailedError is always thrown.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} message - The test description/message. This is usually the only parameter specified when calling this method.
{Object} instanceOfCallStack - an internal JSUnit call stack. Use null for this if you want to get to the next optional parameter. Usually not specified.
{String} userMessage - a user message. Usually not specified.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
// Fails a test. AssertionFailedError is always thrown.
jsunit.fail("Fail test");
jsunit.fail("test", null, "Fail"); // 2nd param is not used in Servoy, params 3 and 1 get merged to form a message. The result is the same as in the line above.
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)