Need advice about simple custom assert

Need advice about simple custom assert

I'm trying to create really simple assert to simplify calls like this(as I have a lot of them):
  1. assert.equal(typeof(externalFunction), "function", "externalFunction() must be defined");


So I've tried this:
  1. QUnit.assert.isFunction = function( testfunc, message ) {
            message = message || ( testfunc ? "okay" : "failed, expected argument to be function, was: " +
                QUnit.dump.parse( testfunc ) );
            this.pushResult( {
                result: "function" == typeof(testfunc),
                actual: typeof(testfunc),
                expected: "function",
                message: message
            } );
        }

It works for defined functions, but throws error "ReferenceError: badfakefunction is not defined" for undefined function
How to create proper assert in my case?