cleanup and docs...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-05-30 00:53:17 +03:00
parent f4b3df077e
commit e4372a785c

34
test.js
View File

@ -138,11 +138,12 @@ var setups = {
return res return res
}, {}) }, }, {}) },
// mixins... /*/ XXX mixins...
mixin: function(assert){ mixin: function(assert){
return { return {
} }, } },
//*/
} }
var modifiers = { var modifiers = {
@ -189,10 +190,10 @@ var tests = {
instance_raw: function(assert, setup){ instance_raw: function(assert, setup){
return this.instance(assert, setup, 'raw') }, return this.instance(assert, setup, 'raw') },
// XXX /*/ XXX
attributes: function(assert, setup){ attributes: function(assert, setup){
return {} return {} },
}, //*/
// XXX // XXX
methods: function(assert, setup){ methods: function(assert, setup){
@ -202,8 +203,7 @@ var tests = {
typeof(O[m]) == 'function' typeof(O[m]) == 'function'
&& O[m]() }) && O[m]() })
}) })
return {} return {} },
},
callables: function(assert, setup){ callables: function(assert, setup){
return instances(setup) return instances(setup)
.map(function([k, o]){ .map(function([k, o]){
@ -216,17 +216,29 @@ var tests = {
// specific independent cases... // specific independent cases...
// XXX not sure about these... //
// NOTE: it is a good idea to migrate tests from here into the main
// framework so as to be able to use them on more setups...
var cases = { var cases = {
'example': function(assert){
assert(true, 'example.')
},
} }
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// XXX need to have two modes: // Test runner...
// - clean //
// - reuse test results again... // This will run
// test(modifier(setup))
// for each test in tests
// for each modifier in modifiers
// for each setup in setups
// case()
// for each case in cases
//
var runner = function(){ var runner = function(){
var stats = { var stats = {
tests: 0, tests: 0,
@ -258,7 +270,7 @@ var runner = function(){
cases[c]( makeAssert(`case:${c}:`, stats) ) }) cases[c]( makeAssert(`case:${c}:`, stats) ) })
// stats... // stats...
console.log('Tests:', stats.tests, console.log('Tests run:', stats.tests,
'Assertions:', stats.assertions, 'Assertions:', stats.assertions,
'Failures:', stats.failures) 'Failures:', stats.failures)