Permalink
Browse files

adding travis support, updated version,

  • Loading branch information...
1 parent b00dc59 commit 09929da0ff079fb1e2f93bfc31ba62b1ca6bc422 @dylang committed Nov 23, 2011
Showing with 55 additions and 16 deletions.
  1. +4 −0 .travis.yml
  2. +3 −0 package.json
  3. +48 −16 test/logging.test.js
View
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
View
@@ -18,6 +18,9 @@
"url": "http://github.com/dylang/logging/issues"
},
"main": "index",
+ "scripts": {
+ "test": "nodeunit test"
+ },
"engines": { "node": ">=0.4.0" },
"licenses" :
[
View
@@ -1,57 +1,89 @@
var log = require('../lib/logging').from(__filename);
+// to run: nodeunit test
module.exports = {
- 'test test': function(assert) {
- assert.ok(true, 'true is true');
+ 'test test': function(test) {
+ test.ok(true, 'true is true');
+ test.done();
},
- 'test log': function(assert) {
+ 'test log': function(test) {
log('test');
- assert.ok(true, 'true is true');
+ test.ok(true, 'true is true');
+ test.done();
},
- 'log multiple inputs': function(assert) {
+ 'log multiple inputs': function(test) {
log('hello', 'world', 1, 2, 'three');
- assert.ok(true, 'true is true');
+ test.ok(true, 'true is true');
+ test.done();
},
- 'log array': function(assert) {
+ 'log array': function(test) {
log('array', [1, 2, 3, 'four', 'five', 'six']);
- assert.ok(true, 'true is true');
+ test.ok(true, 'true is true');
+ test.done();
},
- 'log object': function(assert) {
+ 'log object': function(test) {
log('object', { a: 'apple', b: 'bear', c: ['cookies', 'cake', 'calculators', { abc: 123, def: 'jhi', klm: true, pqr: false }]});
- assert.ok(true, 'true is true');
+ test.ok(true, 'true is true');
+ test.done();
},
- 'function name': function function_name(assert) {
+ 'function name': function function_name(test) {
log('function name');
+ test.done();
+
},
- 'arguments': function SUPERARGTEST(assert) {
+ 'arguments': function SUPERARGTEST(test) {
function YYYY (aaaa) {
log('arguments', arguments);
//log(caller);
//log(callee);
log(arguments.callee.caller.name);
//log(arguments.caller.name);
log(arguments.callee.name);
+
}
function ZZZZ() {
YYYY('i am an argument');
}
ZZZZ();
-
+ test.done();
},
- 'no filename': function (assert) {
- var noFile = require('../lib');
- noFile('i don\'t have a filename');
+ 'foreach': function (test) {
+ 'use strict';
+ ['a', 'b', 'c'].forEach(function(val){
+ log(val);
+ });
+ test.done();
+
+ },
+
+ 'async': function (test) {
+ function A() {
+ log('i have a name');
+ test.done();
+ }
+
+ setTimeout(function(){
+ A();
+ }, 100);
+ },
+
+ 'async inline': function (test) {
+
+ setTimeout(function(){
+ log('i have no name');
+ test.done();
+ }, 100);
}
};

0 comments on commit 09929da

Please sign in to comment.