Skip to content

Expectation::toBeScalar ​

Member of Expectation

idl
Expectation.toBeScalar, $
  /_expect_failure

Verifies that the expectation value is a scalar (a single value). Null is not a scalar. A structure or object reference is a scalar when it contains exactly one element.

Examples ​

idl
(it.expects(42)).toBeScalar
(it.expects('text')).toBeScalar
(it.expects([1, 2]))._not_.toBeScalar

Keywords ​

_expect_failure {#kw-_expect_failure} ​

optionalinputtype=Boolean

If the test fails for some reason, set this to force passing because we expected failure. This keyword is for internal use only.

Licensed under MIT.