class NegatedAssertion
Represents a value ready to be asserted, using inverse logic.
class NegatedAssertion<T> extends Assertion<T>
Instance Members
- toBe(value?)Asserts that the value is not strictly equal to given value (using the
!==
operator). - toBeOneOf(…values)Asserts that the value is not strictly equal to any of given values.
- toEqual(value)Asserts that the value is not loosly equal to given value (using the
!=
operator). - toEqualOneOf(…values)Asserts that the value is not loosely equal to any of given values.
- toBeLessThan(value)Asserts that the value is not less than given value.
- toBeGreaterThan(value)Asserts that the value is not greater than given value.
- toBeLessThanOrEqualTo(value)Asserts that the value is not less than or equal to given value.
- toBeGreaterThanOrEqualTo(value)Asserts that the value is not greater than or equal to given value.
- toBeNaN()Asserts that the value is not
NaN
. - toBeTypeOf(typeStr)Asserts that the value is not of given type.
- toBeArray(match?)Asserts that the value is not an array.
- toBeInstanceOf(C)Asserts that the value is not an instance of given class.
- toMatchRegExp(re)Asserts that the value is a string that doesn’t match given regular expression.
- toHaveProperty(propertyName)Asserts that the value is an object that doesn’t include given property.
- toHaveProperties(object)Asserts that the value is an object that doesn’t include the same properties with the same values (strict equals) as the specified object.
- toHaveMethod(methodName)Asserts that the value is an object that doesn’t include given method.
- toThrowError(…args)Runs a function and asserts that it doesn’t throw an error when called with given arguments.
- toThrowErrorAsync(…args)Runs a function and asserts that it doesn’t throw an error or returns a promise that’s rejected.
Inherited Members
- value readonlyThe value being asserted.
- name readonlyThe name of the assertion, used in error messages.
- not readonlyEvaluates to a new negated assertion, where all methods mean the opposite of those on the current instance.
- asArray()Returns a new assertion for the return value of
Array.from(...)
on the current value. - asBoolean()Returns a new assertion for the boolean representation of the current value.
- asString()Returns a new assertion for the string representation of the current value.
- asNumber()Returns a new assertion for the number representation of the current value.
- asJSONString(replacer?, space?)Returns a new assertion for the JSON representation of the current value.
- toBeTruthy()Evaluates asBoolean().toBe(true).
- toBeFalsy()Evaluates asBoolean().toBe(false).
- toBeUndefined()Evaluates toBe(undefined).
- toBeDefined()Evaluates toBeUndefined().
- toBeNull()Evaluates toBe(null).