Skip to content

lessThanDuration

.lessThanDuration()

Asserts that the tested value is less than the tested value. However, it’s often best to assert that the target is equal to its expected value.

Examples

Basic Usage

expect(cast(double) 0.5).to.be.lessThan(1);
expect(2).to.be.lessThan(2.5);
expect(-1).to.be.lessThan(1u);

With Negation

expect(2).to.be.less(5);
expect(5).not.to.be.less(2);

Modifiers

This assertion supports the following modifiers:

  • .not - Negates the assertion
  • .to - Language chain (no effect)
  • .be - Language chain (no effect)