Comparing version 0.0.1 to 1.0.0
{ | ||
"name": "tpill", | ||
"version": "0.0.1", | ||
"description": "MoNoApps Test Pill", | ||
"version": "1.0.0", | ||
"description": "Sync testing tool", | ||
"main": "tpill.js", | ||
@@ -14,5 +14,4 @@ "scripts": { | ||
"keywords": [ | ||
"mongodb", | ||
"TPill", | ||
"mna" | ||
"test", | ||
"sync" | ||
], | ||
@@ -19,0 +18,0 @@ "author": "Daniel Martinez", |
tpill | ||
===== | ||
Assertion syncronic test. | ||
MoNoApps Test Pill | ||
Usage | ||
install | ||
=== | ||
Install | ||
````bash | ||
npm install tpill | ||
```` | ||
Import, create and run | ||
usage | ||
=== | ||
````js | ||
// import | ||
var TPill = require('tpill').TPill; | ||
var tpill = new TPill(); | ||
// var tpill = new TPill(3000); wait 3 seconds | ||
// add test | ||
tpill.create(1, 1, 'My Test is True', true); | ||
tpill.create(1, '1', 'My Second Test is True ', false); | ||
// run all test | ||
tpill.run(function(){ | ||
@@ -23,1 +29,6 @@ process.exit() | ||
```` | ||
api | ||
=== | ||
tpill.create(current, expected, testName, strict); | ||
tpill.run(callback); |
var TPill = require('../tpill.js').TPill; | ||
var tpill = new TPill(); | ||
var tpill = new TPill(1000); | ||
var assert = require("assert"); | ||
@@ -10,33 +10,33 @@ | ||
assert.ok(tpill instanceof TPill); | ||
}) | ||
}); | ||
it('TPill should have a stats', function(){ | ||
assert.equal('\nStatistics:', tpill.MESSAGES.stats); | ||
}) | ||
assert.equal('\nStatistics:', tpill.MESSAGES.STATS); | ||
}); | ||
it('TPill should have a stats object', function(){ | ||
assert.equal('object', typeof tpill.STATS); | ||
}) | ||
}); | ||
it('TPill should have an emtpy list for tests', function(){ | ||
assert.equal(0, tpill.LIST.length); | ||
}) | ||
}); | ||
it('TPill should add one test to the list', function(){ | ||
tpill.create('test', 'test', 'Must to pass',true); | ||
tpill.create('test', 'test', 'Must to pass', true); | ||
assert.equal(1, tpill.LIST.length); | ||
}) | ||
}); | ||
it('TPill should add on ignored test', function(){ | ||
it('TPill should add an ignored test', function(){ | ||
tpill.create(); | ||
assert.equal(2, tpill.LIST.length); | ||
}) | ||
}); | ||
it('TPill should run and return stats', function(done){ | ||
tpill.create('test', '', 'Must to fail',true); | ||
tpill.create('test', '', 'Must to fail', true); | ||
tpill.run(done); | ||
}) | ||
}); | ||
}) | ||
}); | ||
}) | ||
}); |
12
tpill.js
@@ -7,6 +7,4 @@ /** | ||
this.BALLOT_X = String.fromCharCode(0x2717); | ||
this.SURPRISE = String.fromCharCode(8264); | ||
this.MESSAGES = { | ||
stats: '\nStatistics:' | ||
}; | ||
this.SURPRISE = String.fromCharCode(0x2726); | ||
this.MESSAGES = { STATS: '\nStatistics:' }; | ||
this.TIMEOUT = time || 0; | ||
@@ -38,5 +36,5 @@ this.STATS = { | ||
if (test.strict) { | ||
return (test.current === test.expected) | ||
return (test.current === test.expected); | ||
} else { | ||
return (test.current == test.expected) | ||
return (test.current == test.expected); | ||
} | ||
@@ -69,3 +67,3 @@ }; | ||
setTimeout(function () { | ||
console.log(tpill.MESSAGES['stats'] + ' ' + JSON.stringify(tpill.STATS)); | ||
console.log(tpill.MESSAGES.STATS + ' ' + JSON.stringify(tpill.STATS)); | ||
if (cb){ | ||
@@ -72,0 +70,0 @@ cb(); |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
4917
0
34
100