When Mocha throws exceptions (or rejects Promise
s), it attempts to assign a code
property to the Error
object, for easier handling. These are the potential values of code
.
Members
(static, constant) FATAL
An unrecoverable error.
(static, constant) FORBIDDEN_EXCLUSIVITY
Use of only()
w/ --forbid-only
results in this error.
(static, constant) INSTANCE_ALREADY_DISPOSED
Invalid state transition occurring in Mocha
instance
(static, constant) INSTANCE_ALREADY_RUNNING
Invalid state transition occurring in Mocha
instance
(static, constant) INVALID_ARG_TYPE
The type of an argument to a function call is invalid
(static, constant) INVALID_ARG_VALUE
The value of an argument to a function call is invalid
(static, constant) INVALID_EXCEPTION
Something was thrown, but it wasn't an Error
(static, constant) INVALID_INTERFACE
An interface (e.g., Mocha.interfaces
) is unknown or invalid
(static, constant) INVALID_PLUGIN_DEFINITION
To be thrown when a builtin or third-party plugin definition (the definition of mochaHooks
) is invalid
(static, constant) INVALID_PLUGIN_IMPLEMENTATION
To be thrown when a user-defined plugin implementation (e.g., mochaHooks
) is invalid
(static, constant) INVALID_REPORTER
A reporter (.e.g, Mocha.reporters
) is unknown or invalid
(static, constant) MULTIPLE_DONE
done()
was called twice in a Test
or Hook
callback
(static, constant) NO_FILES_MATCH_PATTERN
No files matched the pattern provided by the user
(static, constant) TIMEOUT
When a runnable exceeds its allowed run time.
(static, constant) UNPARSABLE_FILE
Input file is not able to be parsed
(static, constant) UNSUPPORTED
Known, but unsupported behavior of some kind