Could this live in an external file (typically called `$(this.promise_filename).sub`)?  That would reduce the test significantly.