Skip to content
Myr

app.render.js

This file

Path

test/app.render.js

374 lines · 10.3 KiB · JavaScript

Last changed by

fix(refactor): prefix built-in node module importsSzymon Łągiewkabefore adoption4111359

History of this file

Take it

The walk stopped after 200 commits: lines older than 2a0c35a point at it.

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 1why, one step back
1'use strict'

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 2why, one step back
2

fix(refactor): prefix built-in node module importsSzymon Łągiewkabefore adoption4111359

line 3why, one step back
3var assert = require('node:assert')

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 4why, one step back
4var express = require('..');

fix(refactor): prefix built-in node module importsSzymon Łągiewkabefore adoption4111359

line 5why, one step back
5var path = require('node:path')

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 6why, one step back
6var tmpl = require('./support/tmpl');

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 7–10why, one step back
7
8describe('app', function(){9 describe('.render(name, fn)', function(){10 it('should support absolute paths', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 11why, one step back
11 var app = createApp();

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 12–14why, one step back
12
13 app.locals.user = { name: 'tobi' };14

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

line 15why, one step back
15 app.render(path.join(__dirname, 'fixtures', 'user.tmpl'), function (err, str) {

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 16why, one step back
16 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 17why, one step back
17 assert.strictEqual(str, '<p>tobi</p>')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 18–22why, one step back
18 done();
19 })20 })2122 it('should support absolute paths with "view engine"', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 23why, one step back
23 var app = createApp();

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 24why, one step back
24

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 25why, one step back
25 app.set('view engine', 'tmpl');

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 26–27why, one step back
26 app.locals.user = { name: 'tobi' };
27

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

line 28why, one step back
28 app.render(path.join(__dirname, 'fixtures', 'user'), function (err, str) {

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 29why, one step back
29 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 30why, one step back
30 assert.strictEqual(str, '<p>tobi</p>')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 31–35why, one step back
31 done();
32 })33 })3435 it('should expose app.locals', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 36why, one step back
36 var app = createApp();

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 37why, one step back
37

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

line 38why, one step back
38 app.set('views', path.join(__dirname, 'fixtures'))

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 39–40why, one step back
39 app.locals.user = { name: 'tobi' };
40

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 41why, one step back
41 app.render('user.tmpl', function (err, str) {

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 42why, one step back
42 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 43why, one step back
43 assert.strictEqual(str, '<p>tobi</p>')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 44–48why, one step back
44 done();
45 })46 })4748 it('should support index.<engine>', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 49why, one step back
49 var app = createApp();

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 50why, one step back
50

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

line 51why, one step back
51 app.set('views', path.join(__dirname, 'fixtures'))

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 52why, one step back
52 app.set('view engine', 'tmpl');

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 53why, one step back
53

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 54why, one step back
54 app.render('blog/post', function (err, str) {

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 55why, one step back
55 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 56why, one step back
56 assert.strictEqual(str, '<h1>blog post</h1>')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 57–75why, one step back
57 done();
58 })59 })6061 it('should handle render error throws', function(done){62 var app = express();6364 function View(name, options){65 this.name = name;66 this.path = 'fale';67 }6869 View.prototype.render = function(options, fn){70 throw new Error('err!');71 };7273 app.set('view', View);7475 app.render('something', function(err, str){

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 76–77why, one step back
76 assert.ok(err)
77 assert.strictEqual(err.message, 'err!')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 78–83why, one step back
78 done();
79 })80 })8182 describe('when the file does not exist', function(){83 it('should provide a helpful error', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

lines 84–85why, one step back
84 var app = createApp();
85

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

line 86why, one step back
86 app.set('views', path.join(__dirname, 'fixtures'))

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 87why, one step back
87 app.render('rawr.tmpl', function (err) {

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

lines 88–89why, one step back
88 assert.ok(err)
89 assert.equal(err.message, 'Failed to lookup view "rawr.tmpl" in views directory "' + path.join(__dirname, 'fixtures') + '"')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 90–96why, one step back
90 done();
91 });92 })93 })9495 describe('when an error occurs', function(){96 it('should invoke the callback', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 97why, one step back
97 var app = createApp();

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 98why, one step back
98

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

line 99why, one step back
99 app.set('views', path.join(__dirname, 'fixtures'))

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 100why, one step back
100

Merge tag '4.15.5'Douglas Christopher Wilsonbefore adoption19c8d64

lines 101–104why, one step back
101 app.render('user.tmpl', function (err) {
102 assert.ok(err)103 assert.equal(err.name, 'RenderError')104 done()

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 105–110why, one step back
105 })
106 })107 })108109 describe('when an extension is given', function(){110 it('should render the template', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 111why, one step back
111 var app = createApp();

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 112why, one step back
112

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

line 113why, one step back
113 app.set('views', path.join(__dirname, 'fixtures'))

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 114why, one step back
114

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 115why, one step back
115 app.render('email.tmpl', function (err, str) {

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 116why, one step back
116 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 117why, one step back
117 assert.strictEqual(str, '<p>This is an email</p>')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 118–124why, one step back
118 done();
119 })120 })121 })122123 describe('when "view engine" is given', function(){124 it('should render the template', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 125why, one step back
125 var app = createApp();

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 126why, one step back
126

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 127why, one step back
127 app.set('view engine', 'tmpl');

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

line 128why, one step back
128 app.set('views', path.join(__dirname, 'fixtures'))

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 129–131why, one step back
129
130 app.render('email', function(err, str){131 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 132why, one step back
132 assert.strictEqual(str, '<p>This is an email</p>')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 133–137why, one step back
133 done();
134 })135 })136 })137

Add support for app.set('views', array)Douglas Christopher Wilsonbefore adoption6614352

lines 138–139why, one step back
138 describe('when "views" is given', function(){
139 it('should lookup the file in the path', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 140why, one step back
140 var app = createApp();

Add support for app.set('views', array)Douglas Christopher Wilsonbefore adoption6614352

line 141why, one step back
141

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

line 142why, one step back
142 app.set('views', path.join(__dirname, 'fixtures', 'default_layout'))

Add support for app.set('views', array)Douglas Christopher Wilsonbefore adoption6614352

lines 143–144why, one step back
143 app.locals.user = { name: 'tobi' };
144

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 145why, one step back
145 app.render('user.tmpl', function (err, str) {

Add support for app.set('views', array)Douglas Christopher Wilsonbefore adoption6614352

line 146why, one step back
146 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 147why, one step back
147 assert.strictEqual(str, '<p>tobi</p>')

Add support for app.set('views', array)Douglas Christopher Wilsonbefore adoption6614352

lines 148–153why, one step back
148 done();
149 })150 })151152 describe('when array of paths', function(){153 it('should lookup the file in the path', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 154why, one step back
154 var app = createApp();

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

lines 155–158why, one step back
155 var views = [
156 path.join(__dirname, 'fixtures', 'local_layout'),157 path.join(__dirname, 'fixtures', 'default_layout')158 ]

Add support for app.set('views', array)Douglas Christopher Wilsonbefore adoption6614352

lines 159–162why, one step back
159
160 app.set('views', views);161 app.locals.user = { name: 'tobi' };162

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 163why, one step back
163 app.render('user.tmpl', function (err, str) {

Add support for app.set('views', array)Douglas Christopher Wilsonbefore adoption6614352

line 164why, one step back
164 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 165why, one step back
165 assert.strictEqual(str, '<span>tobi</span>')

Add support for app.set('views', array)Douglas Christopher Wilsonbefore adoption6614352

lines 166–170why, one step back
166 done();
167 })168 })169170 it('should lookup in later paths until found', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 171why, one step back
171 var app = createApp();

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

lines 172–175why, one step back
172 var views = [
173 path.join(__dirname, 'fixtures', 'local_layout'),174 path.join(__dirname, 'fixtures', 'default_layout')175 ]

Add support for app.set('views', array)Douglas Christopher Wilsonbefore adoption6614352

lines 176–179why, one step back
176
177 app.set('views', views);178 app.locals.name = 'tobi';179

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 180why, one step back
180 app.render('name.tmpl', function (err, str) {

Add support for app.set('views', array)Douglas Christopher Wilsonbefore adoption6614352

line 181why, one step back
181 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 182why, one step back
182 assert.strictEqual(str, '<p>tobi</p>')

Add support for app.set('views', array)Douglas Christopher Wilsonbefore adoption6614352

lines 183–187why, one step back
183 done();
184 })185 })186187 it('should error if file does not exist', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 188why, one step back
188 var app = createApp();

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

lines 189–192why, one step back
189 var views = [
190 path.join(__dirname, 'fixtures', 'local_layout'),191 path.join(__dirname, 'fixtures', 'default_layout')192 ]

Add support for app.set('views', array)Douglas Christopher Wilsonbefore adoption6614352

lines 193–196why, one step back
193
194 app.set('views', views);195 app.locals.name = 'tobi';196

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 197why, one step back
197 app.render('pet.tmpl', function (err, str) {

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

lines 198–199why, one step back
198 assert.ok(err)
199 assert.equal(err.message, 'Failed to lookup view "pet.tmpl" in views directories "' + views[0] + '" or "' + views[1] + '"')

Add support for app.set('views', array)Douglas Christopher Wilsonbefore adoption6614352

lines 200–205why, one step back
200 done();
201 })202 })203 })204 })205

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 206–222why, one step back
206 describe('when a "view" constructor is given', function(){
207 it('should create an instance of it', function(done){208 var app = express();209210 function View(name, options){211 this.name = name;212 this.path = 'path is required by application.js as a signal of success even though it is not used there.';213 }214215 View.prototype.render = function(options, fn){216 fn(null, 'abstract engine');217 };218219 app.set('view', View);220221 app.render('something', function(err, str){222 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 223why, one step back
223 assert.strictEqual(str, 'abstract engine')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 224–248why, one step back
224 done();
225 })226 })227 })228229 describe('caching', function(){230 it('should always lookup view without cache', function(done){231 var app = express();232 var count = 0;233234 function View(name, options){235 this.name = name;236 this.path = 'fake';237 count++;238 }239240 View.prototype.render = function(options, fn){241 fn(null, 'abstract engine');242 };243244 app.set('view cache', false);245 app.set('view', View);246247 app.render('something', function(err, str){248 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 249–250why, one step back
249 assert.strictEqual(count, 1)
250 assert.strictEqual(str, 'abstract engine')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 251–252why, one step back
251 app.render('something', function(err, str){
252 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 253–254why, one step back
253 assert.strictEqual(count, 2)
254 assert.strictEqual(str, 'abstract engine')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 255–278why, one step back
255 done();
256 })257 })258 })259260 it('should cache with "view cache" setting', function(done){261 var app = express();262 var count = 0;263264 function View(name, options){265 this.name = name;266 this.path = 'fake';267 count++;268 }269270 View.prototype.render = function(options, fn){271 fn(null, 'abstract engine');272 };273274 app.set('view cache', true);275 app.set('view', View);276277 app.render('something', function(err, str){278 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 279–280why, one step back
279 assert.strictEqual(count, 1)
280 assert.strictEqual(str, 'abstract engine')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 281–282why, one step back
281 app.render('something', function(err, str){
282 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 283–284why, one step back
283 assert.strictEqual(count, 1)
284 assert.strictEqual(str, 'abstract engine')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 285–293why, one step back
285 done();
286 })287 })288 })289 })290 })291292 describe('.render(name, options, fn)', function(){293 it('should render the template', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 294why, one step back
294 var app = createApp();

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 295why, one step back
295

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

line 296why, one step back
296 app.set('views', path.join(__dirname, 'fixtures'))

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 297–299why, one step back
297
298 var user = { name: 'tobi' };299

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 300why, one step back
300 app.render('user.tmpl', { user: user }, function (err, str) {

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 301why, one step back
301 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 302why, one step back
302 assert.strictEqual(str, '<p>tobi</p>')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 303–307why, one step back
303 done();
304 })305 })306307 it('should expose app.locals', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 308why, one step back
308 var app = createApp();

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 309why, one step back
309

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

line 310why, one step back
310 app.set('views', path.join(__dirname, 'fixtures'))

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 311–312why, one step back
311 app.locals.user = { name: 'tobi' };
312

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 313why, one step back
313 app.render('user.tmpl', {}, function (err, str) {

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 314why, one step back
314 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 315why, one step back
315 assert.strictEqual(str, '<p>tobi</p>')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 316–320why, one step back
316 done();
317 })318 })319320 it('should give precedence to app.render() locals', function(done){

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 321why, one step back
321 var app = createApp();

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 322why, one step back
322

Merge tag '4.15.2'Douglas Christopher Wilsonbefore adoptione5dbb0c

line 323why, one step back
323 app.set('views', path.join(__dirname, 'fixtures'))

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 324–326why, one step back
324 app.locals.user = { name: 'tobi' };
325 var jane = { name: 'jane' };326

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

line 327why, one step back
327 app.render('user.tmpl', { user: jane }, function (err, str) {

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

line 328why, one step back
328 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

line 329why, one step back
329 assert.strictEqual(str, '<p>jane</p>')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 330–353why, one step back
330 done();
331 })332 })333334 describe('caching', function(){335 it('should cache with cache option', function(done){336 var app = express();337 var count = 0;338339 function View(name, options){340 this.name = name;341 this.path = 'fake';342 count++;343 }344345 View.prototype.render = function(options, fn){346 fn(null, 'abstract engine');347 };348349 app.set('view cache', false);350 app.set('view', View);351352 app.render('something', {cache: true}, function(err, str){353 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 354–355why, one step back
354 assert.strictEqual(count, 1)
355 assert.strictEqual(str, 'abstract engine')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 356–357why, one step back
356 app.render('something', {cache: true}, function(err, str){
357 if (err) return done(err);

Merge tag '4.17.3'Douglas Christopher Wilsonbefore adoption318fd4b

lines 358–359why, one step back
358 assert.strictEqual(count, 1)
359 assert.strictEqual(str, 'abstract engine')

Invoke callback for sendfile when client abortsDouglas Christopher Wilsonbefore adoption2a0c35a

lines 360–366why, one step back
360 done();
361 })362 })363 })364 })365 })366})

Merge tag '4.11.1'Douglas Christopher Wilsonbefore adoption8a5ecd3

lines 367–374why, one step back
367
368function createApp() {369 var app = express();370371 app.engine('.tmpl', tmpl);372373 return app;374}