Skip to content
Myr

Added app.engine() tests

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent f98c112 · Browse files · 3 files+42 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+42 added−3 removed

  • tests:+39 added−0 removed
  • other:+3 added−3 removed

3 files+42 added−3 removed

modified:lib/application.js+3 added-3 removed
250 unmodified lines
251 * Register the given template engine callback `fn`252 * as `ext`. For example we may wish to map ".html"253 * files to ejs rather than using the ".ejs" extension.254 *255 * app.register('.html', require('ejs').render);255 * app.engine('.html', require('ejs').render);256 *257 * or258 *259 * app.register('html', require('ejs').render);259 * app.engine('html', require('ejs').render);260 *261 * @param {String} ext262 * @param {Function} fn263 * @return {Server} for chaining264 * @api public265 */266267app.register = function(ext, fn){267app.engine = function(ext, fn){268 if ('.' != ext[0]) ext = '.' + ext;269 this.engines[ext] = fn;270 return this;271};
318 unmodified lines
added:test/fixtures/user.html+1 added
added:test/app.engine.js+38 added