@@ -37,8 +37,8 @@ describe('express(1)', function () {
37
37
} )
38
38
} )
39
39
40
- it ( 'should print jade view warning' , function ( ) {
41
- assert . strictEqual ( ctx . stderr , "\n warning: the default view engine will not be jade in future releases \n warning: use `--view=jade' or `--help' for additional options\n\n" )
40
+ it ( 'should print pug view warning' , function ( ) {
41
+ assert . strictEqual ( ctx . stderr , "\n warning: the default view engine is pug now \n warning: use `--view=jade' if you want to use jade or `--help' for additional options\n\n" )
42
42
} )
43
43
44
44
it ( 'should provide debug instructions' , function ( ) {
@@ -51,10 +51,10 @@ describe('express(1)', function () {
51
51
assert . notStrictEqual ( ctx . files . indexOf ( 'package.json' ) , - 1 )
52
52
} )
53
53
54
- it ( 'should have jade templates' , function ( ) {
55
- assert . notStrictEqual ( ctx . files . indexOf ( 'views/error.jade ' ) , - 1 )
56
- assert . notStrictEqual ( ctx . files . indexOf ( 'views/index.jade ' ) , - 1 )
57
- assert . notStrictEqual ( ctx . files . indexOf ( 'views/layout.jade ' ) , - 1 )
54
+ it ( 'should have pug templates' , function ( ) {
55
+ assert . notStrictEqual ( ctx . files . indexOf ( 'views/error.pug ' ) , - 1 )
56
+ assert . notStrictEqual ( ctx . files . indexOf ( 'views/index.pug ' ) , - 1 )
57
+ assert . notStrictEqual ( ctx . files . indexOf ( 'views/layout.pug ' ) , - 1 )
58
58
} )
59
59
60
60
it ( 'should have a package.json file' , function ( ) {
@@ -72,8 +72,8 @@ describe('express(1)', function () {
72
72
' "debug": "~2.6.9",\n' +
73
73
' "express": "~4.16.1",\n' +
74
74
' "http-errors": "~1.6.3",\n' +
75
- ' "jade ": "~1.11.0 ",\n' +
76
- ' "morgan ": "~1.9.1 "\n' +
75
+ ' "morgan ": "~1.9.1 ",\n' +
76
+ ' "pug ": "~2.0.4 "\n' +
77
77
' }\n' +
78
78
'}\n' )
79
79
} )
@@ -222,10 +222,10 @@ describe('express(1)', function () {
222
222
assert . notStrictEqual ( ctx . files . indexOf ( 'foo/package.json' ) , - 1 )
223
223
} )
224
224
225
- it ( 'should have jade templates' , function ( ) {
226
- assert . notStrictEqual ( ctx . files . indexOf ( 'foo/views/error.jade ' ) , - 1 )
227
- assert . notStrictEqual ( ctx . files . indexOf ( 'foo/views/index.jade ' ) , - 1 )
228
- assert . notStrictEqual ( ctx . files . indexOf ( 'foo/views/layout.jade ' ) , - 1 )
225
+ it ( 'should have pug templates' , function ( ) {
226
+ assert . notStrictEqual ( ctx . files . indexOf ( 'foo/views/error.pug ' ) , - 1 )
227
+ assert . notStrictEqual ( ctx . files . indexOf ( 'foo/views/index.pug ' ) , - 1 )
228
+ assert . notStrictEqual ( ctx . files . indexOf ( 'foo/views/layout.pug ' ) , - 1 )
229
229
} )
230
230
} )
231
231
@@ -475,10 +475,10 @@ describe('express(1)', function () {
475
475
assert . notStrictEqual ( ctx . files . indexOf ( '.gitignore' ) , - 1 , 'should have .gitignore file' )
476
476
} )
477
477
478
- it ( 'should have jade templates' , function ( ) {
479
- assert . notStrictEqual ( ctx . files . indexOf ( 'views/error.jade ' ) , - 1 )
480
- assert . notStrictEqual ( ctx . files . indexOf ( 'views/index.jade ' ) , - 1 )
481
- assert . notStrictEqual ( ctx . files . indexOf ( 'views/layout.jade ' ) , - 1 )
478
+ it ( 'should have pug templates' , function ( ) {
479
+ assert . notStrictEqual ( ctx . files . indexOf ( 'views/error.pug ' ) , - 1 )
480
+ assert . notStrictEqual ( ctx . files . indexOf ( 'views/index.pug ' ) , - 1 )
481
+ assert . notStrictEqual ( ctx . files . indexOf ( 'views/layout.pug ' ) , - 1 )
482
482
} )
483
483
} )
484
484
@@ -1004,6 +1004,71 @@ describe('express(1)', function () {
1004
1004
} )
1005
1005
} )
1006
1006
1007
+ describe ( 'jade' , function ( ) {
1008
+ var ctx = setupTestEnvironment ( this . fullTitle ( ) )
1009
+
1010
+ it ( 'should create basic app with jade templates' , function ( done ) {
1011
+ run ( ctx . dir , [ '--view' , 'jade' ] , function ( err , stdout ) {
1012
+ if ( err ) return done ( err )
1013
+ ctx . files = utils . parseCreatedFiles ( stdout , ctx . dir )
1014
+ assert . strictEqual ( ctx . files . length , 16 )
1015
+ done ( )
1016
+ } )
1017
+ } )
1018
+
1019
+ it ( 'should have basic files' , function ( ) {
1020
+ assert . notStrictEqual ( ctx . files . indexOf ( 'bin/www' ) , - 1 )
1021
+ assert . notStrictEqual ( ctx . files . indexOf ( 'app.js' ) , - 1 )
1022
+ assert . notStrictEqual ( ctx . files . indexOf ( 'package.json' ) , - 1 )
1023
+ } )
1024
+
1025
+ it ( 'should have jade in package dependencies' , function ( ) {
1026
+ var file = path . resolve ( ctx . dir , 'package.json' )
1027
+ var contents = fs . readFileSync ( file , 'utf8' )
1028
+ var dependencies = JSON . parse ( contents ) . dependencies
1029
+ assert . ok ( typeof dependencies . jade === 'string' )
1030
+ } )
1031
+
1032
+ it ( 'should have jade templates' , function ( ) {
1033
+ assert . notStrictEqual ( ctx . files . indexOf ( 'views/error.jade' ) , - 1 )
1034
+ assert . notStrictEqual ( ctx . files . indexOf ( 'views/index.jade' ) , - 1 )
1035
+ assert . notStrictEqual ( ctx . files . indexOf ( 'views/layout.jade' ) , - 1 )
1036
+ } )
1037
+
1038
+ it ( 'should have installable dependencies' , function ( done ) {
1039
+ this . timeout ( NPM_INSTALL_TIMEOUT )
1040
+ npmInstall ( ctx . dir , done )
1041
+ } )
1042
+
1043
+ describe ( 'npm start' , function ( ) {
1044
+ before ( 'start app' , function ( ) {
1045
+ this . app = new AppRunner ( ctx . dir )
1046
+ } )
1047
+
1048
+ after ( 'stop app' , function ( done ) {
1049
+ this . timeout ( APP_START_STOP_TIMEOUT )
1050
+ this . app . stop ( done )
1051
+ } )
1052
+
1053
+ it ( 'should start app' , function ( done ) {
1054
+ this . timeout ( APP_START_STOP_TIMEOUT )
1055
+ this . app . start ( done )
1056
+ } )
1057
+
1058
+ it ( 'should respond to HTTP request' , function ( done ) {
1059
+ request ( this . app )
1060
+ . get ( '/' )
1061
+ . expect ( 200 , / < t i t l e > E x p r e s s < \/ t i t l e > / , done )
1062
+ } )
1063
+
1064
+ it ( 'should generate a 404' , function ( done ) {
1065
+ request ( this . app )
1066
+ . get ( '/does_not_exist' )
1067
+ . expect ( 404 , / < h 1 > N o t F o u n d < \/ h 1 > / , done )
1068
+ } )
1069
+ } )
1070
+ } )
1071
+
1007
1072
describe ( 'twig' , function ( ) {
1008
1073
var ctx = setupTestEnvironment ( this . fullTitle ( ) )
1009
1074
0 commit comments