ngn-idk-core
Version:
39 lines (33 loc) • 1.3 kB
JavaScript
var assert = require('assert'),
path = require('path');
/**
* Make sure the NGN core is available.
*/
suite('IDK Core Sanity Test', function(){
var dir = null,
p = path.join(__dirname,'..','lib','core');
setup(function(){
dir = require('fs').readdirSync(p);
assert.ok(NGN !== undefined,'NGN did not load.');
assert.ok(UTIL !== undefined,'UTIL did not load.');
UTIL.testing = true;
});
test('Core classes are in the NGN.core.', function(){
dir.forEach(function(file){
assert.ok(NGN.core[path.basename(file,'.js')] !== undefined,'NGN.core.'+path.basename(file,'.js')+' not loaded.');
});
});
test('Core classes construct properly.', function(){
dir.forEach(function(file){
switch (path.basename(file,'.js')){
case 'HttpTransport':
assert.ok(new NGN.core[path.basename(file,'.js')]({routes:path.resolve(__dirname,'routes'),autoStart:false}) !== undefined,'NGN.core.'+path.basename(file,'.js')+' not loaded.');
break;
default:
assert.ok(new NGN.core[path.basename(file,'.js')]() !== undefined,'NGN.core.'+path.basename(file,'.js')+' not loaded.');
}
});
});
});
//TODO: Functional tests
//TODO: Test NGN Mechanic integration for Process