@remobid/js-lib-asserts
v1.0.0
Published
assertion testing library
Downloads
9
Readme
Assertion Library
This is a standalone version of the assertion library of the google closure library.
API
For details see the original code
- assertEquals(failureMessage, expectedValue, actualValue)
- will use ===
- assertNotEquals(failureMessage, expectedValue, actualValue)
- will use !==
- assertTrue(failureMessage, value)
- assertFalse(failureMessage, value)
- assertNull(failureMessage, value)
- assertNotNull(failureMessage, value)
- assertUndefined(failureMessage, value)
- assertNotUndefined(failureMessage, value)
- assertNotNullNorUndefined(failureMessage, value)
- assertNonEmptyString(failureMessage, value)
- assertNaN(failureMessage, value)
- assertNotNaN(failureMessage, value)
- assertRegExp(failureMessage, value)
- Checks if the given string matches the given regular expression.
- assertObjectEquals(failureMessage, expectedValue, actualValue)
- assertObjectNotEquals(failureMessage, expectedValue, actualValue, tolerance)
- assertObjectRoughlyEquals(failureMessage, expectedValue, actualValue)
- assertArrayEquals(failureMessage, expectedValue, actualValue)
- assertElementsEquals(failureMessage, expectedValue, actualValue)
- assertElementsRoughlyEqual(failureMessage, expectedValue, actualValue, tolerance)
- assertSameElements(failureMessage, expectedValue, actualValue)
- assertRoughlyEquals(failureMessage, expectedValue, actualValue, tolerance)
- assertContains(failureMessage, needle, haystack)
- Checks if needle is part of haystack by using .indexOf on the haystack
- assertNotContains(failureMessage, needle, haystack)
- Checks if needle is not part of haystack by using .indexOf on the haystack
- assertEvaluatesToTrue(failureMessage, value)
- assertEvaluatesToFalse(failureMessage, value)
- assertThrows(failureMessage, functionToCall)
- assertNotThrows(failureMessage, functionToCall)