-
-
Notifications
You must be signed in to change notification settings - Fork 672
Closed
Labels
Description
I'm developing an assertion library, and it would be helpful to be able to assert if a type is a function.
A simple use case is the toThrow()
expectation function.
@inline
public toThrow(message: string = ""): void {
// assert(isFunction<T>(), "toThrow expectation must be called on a function type.");
var throws: bool = !tryCall(this.actual!);
reportActualString<string>(throws ? "throws" : "not throws");
reportExpectedString("throws", this._not);
assert(this._not ^ throws, message);
clearExpected();
}