Skip to content
Myr

Added default expresso tests to express(1) generated app. Closes #384

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 4778f72 · Browse files · 1 file+33 added−2 removed
This commit

State

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

Diff stats

1 file+33 added−2 removed

  • other:+33 added−2 removed

1 file+33 added−2 removed

modified:bin/express+33 added-2 removed
57 unmodified lines
58 'p Welcome to #{title}'59].join('\n');6061/**62 * App test template.63 */6465var appTest = [66 "",67 "// Run $ expresso",68 "",69 "/**",70 " * Module dependencies.",71 " */",72 "",73 "var app = require('../app');",74 "",75 "module.exports = {",76 " 'GET /': function(assert){",77 " assert.response(app,",78 " { url: '/' },",79 " { status: 200, headers: { 'Content-Type': 'text/html; charset=utf-8' }},",80 " function(res){",81 " assert.includes(res.body, '<title>Express</title>');",82 " });",83 " }",84 "};",85].join('\n');8687/**88 * App template.89 */9091var app = [
4 unmodified lines
96 '',97 'var express = require(\'express\'),',98 ' connect = require(\'connect\');',99 '',74 'var app = express.createServer();',100 'var app = module.exports = express.createServer();',101 '',102 '// Configuration',103 '',104 'app.configure(function(){',
22 unmodified lines
127 ' }',128 ' });',129 '});',130 '',105 'app.listen(3000);',131 '// Only listen on $ node app.js',132 '',133 'if (!module.parent) app.listen(3000);',134 ''135].join('\n');136137// Parse arguments
30 unmodified lines
168 mkdir(path + '/views/partials', function(){169 write(path + '/views/layout.jade', jadeLayout);170 write(path + '/views/index.jade', jadeIndex);171 });172 mkdir(path + '/test', function(){173 write(path + '/test/app.test.js', appTest);174 });175 write(path + '/app.js', app);176 });177})(path);178
37 unmodified lines