Comparing version 0.0.17 to 0.1.0
@@ -300,3 +300,8 @@ 'use strict'; | ||
{ | ||
var subResult = new TestResult(key); | ||
var testKey = key; | ||
if (isNumber(key) && value.name) | ||
{ | ||
testKey = value.name; | ||
} | ||
var subResult = new TestResult(testKey); | ||
// it is a function to run | ||
@@ -369,2 +374,7 @@ next = getNext(key, subResult, callback); | ||
}, | ||
g: [function(callback) { | ||
callback(null, 'g0'); | ||
}, function two(callback) { | ||
callback(null, 'g1'); | ||
}], | ||
}; | ||
@@ -385,2 +395,10 @@ exports.run(series, function(error, result) | ||
console.assert(result.results.b.results.e.message == 'e', 'Should have a e for b.e'); | ||
console.assert(result.results.g, 'Should have result for g'); | ||
console.assert(result.results.g.success, 'Should have success for g'); | ||
console.assert(result.results.g.results[0], 'Should have result for g[0]'); | ||
console.assert(result.results.g.results[0].success, 'Should have success for g[0]'); | ||
console.assert(result.results.g.results[0].message == 'g0', 'Should have g0 for g[0]'); | ||
console.assert(result.results.g.results.two, 'Should have result for two'); | ||
console.assert(result.results.g.results.two.success, 'Should have success for two'); | ||
console.assert(result.results.g.results.two.message == 'g1', 'Should have g1 for two'); | ||
log.info('Test run successful with 2 failures: %s', result); | ||
@@ -456,7 +474,18 @@ }); | ||
{ | ||
console.assert(isEmpty({}), 'Empty should be empty'); | ||
console.assert(!isEmpty({a: 'a'}), 'Not empty is empty'); | ||
console.assert(isEmpty({}), 'Empty object should be empty'); | ||
console.assert(!isEmpty({a: 'a'}), 'Not empty object is empty'); | ||
console.assert(isEmpty([]), 'Empty array should be empty'); | ||
console.assert(!isEmpty(['a']), 'Not empty array is empty'); | ||
} | ||
/** | ||
* Find out if the argument is a number. | ||
* http://stackoverflow.com/a/1830844/978796 | ||
*/ | ||
function isNumber(n) | ||
{ | ||
return !isNaN(parseFloat(n)) && isFinite(n); | ||
} | ||
/** | ||
* Run all module tests. | ||
@@ -463,0 +492,0 @@ * Cannot use testing since it is not defined yet. |
{ | ||
"name": "testing", | ||
"version": "0.0.17", | ||
"version": "0.1.0", | ||
"description": "Simple asynchronous testing framework. Never again count your asserts! This tiny testing library is fully callback-based and has a rich API for asserts.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/alexfernandez/testing", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25861
767