@@ -2,27 +2,28 @@ var assert = require('assert');
22
33exports . run = function ( framework , name ) {
44
5- console . log ( 'run test: {0}' . format ( name ) ) ;
6- console . log ( '' ) ;
5+ /**
6+ * @see {@link http://docs.totaljs.com/Framework/#framework.assert|Documentation }
7+ */
78
8- // Documentation: http://docs.totaljs.com/Framework/#framework.assert
9-
10- framework . assert ( 'Test methods' , function ( name ) {
11- assert . ok ( framework . controller ( 'default' ) . functions . increment ( 1 ) === 2 , name + ' default controller: increment()' ) ;
9+ framework . assert ( 'controller.increment()' , function ( next , name ) {
10+ assert . ok ( framework . controller ( 'default' ) . functions . increment ( 1 ) === 2 , name ) ;
11+ next ( ) ;
1212 } ) ;
13-
14- framework . assert ( 'Test URL 1' , '/1/' , function ( error , data , name , code , headers ) {
13+
14+ framework . assert ( 'Test URL 1' , '/1/' , [ 'GET' ] , function ( error , data , code , headers , cookies , name ) {
15+ console . log ( data , code )
1516 assert . ok ( code === 200 && data === '1' , name ) ;
1617 console . log ( '1' ) ;
1718 } ) ;
1819
19- framework . assert ( 'Test URL 2' , '/2/' , function ( error , data , name , code , headers ) {
20+ framework . assert ( 'Test URL 2' , '/2/' , [ 'GET' ] , function ( error , data , code , headers , cookies , name ) {
2021 assert . ok ( code === 200 && data === '2' , name ) ;
2122 console . log ( '2' ) ;
2223 } ) ;
2324
24- framework . assert ( 'Test URL 3' , '/3/' , function ( error , data , name , code , headers ) {
25- // throw error, data === 4
25+ framework . assert ( 'Test URL 3' , '/3/' , [ 'GET' ] , function ( error , data , code , headers , cookies , name ) {
26+ // throws error, data === 4
2627 assert . ok ( code === 200 && data === '3' , name ) ;
2728 console . log ( '3' ) ;
2829 } ) ;
0 commit comments