Skip to content

Commit b245055

Browse files
committed
updated: code
1 parent 3bd47e8 commit b245055

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

assertion-testing/controllers/default.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ exports.install = function(framework) {
44
framework.route('/3/', test3);
55
};
66

7+
exports.functions = {
8+
increment: function(num) {
9+
return num + 1;
10+
}
11+
};
12+
713
function test1() {
814
this.plain('1');
915
}

assertion-testing/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@ framework.run(http, debug);
77

88
// Documentation: http://docs.totaljs.com/Framework/#framework.test
99
framework.test(true, function() {
10-
console.log('SUCCESSS');
10+
console.log('');
11+
console.log('====================================================');
12+
console.log('Congratulations, the test was successful!');
13+
console.log('====================================================');
14+
console.log('');
1115
});

assertion-testing/tests/default.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ exports.run = function(framework, name) {
77

88
// Documentation: http://docs.totaljs.com/Framework/#framework.assert
99

10+
framework.assert('Test methods', function(name) {
11+
assert.ok(framework.controller('default').functions.increment(1) === 2, name + ' default controller: increment()');
12+
});
13+
1014
framework.assert('Test URL 1', '/1/', function(error, data, name, code, headers) {
1115
assert.ok(code === 200 && data === '1', name);
1216
console.log('1');
@@ -22,4 +26,5 @@ exports.run = function(framework, name) {
2226
assert.ok(code === 200 && data === '3', name);
2327
console.log('3');
2428
});
29+
2530
};

0 commit comments

Comments
 (0)