Initial work on getting tests to run, some working

This commit is contained in:
David Humphrey (:humph) david.humphrey@senecacollege.ca 2014-05-16 12:37:34 -04:00 committed by Kieran Sedgwick
parent 73392d3f35
commit c18660a2ed
3 changed files with 87 additions and 2 deletions

View File

@ -43,6 +43,9 @@
"grunt-npm": "git://github.com/sedge/grunt-npm.git#branchcheck",
"grunt-prompt": "^1.1.0",
"habitat": "^1.1.0",
"semver": "^2.3.0"
"semver": "^2.3.0",
"requirejs": "~2.1.11",
"mocha": "~1.18.2",
"chai": "~1.9.1"
}
}

View File

@ -60,7 +60,7 @@ function(Filer, IndexedDBTestProvider, WebSQLTestProvider, MemoryTestProvider) {
// Create a file system and wait for it to get setup
_provider.init();
console.log('here!');
function complete(err, fs) {
if(err) throw err;
_fs = fs;

82
tests/node-runner.js Normal file
View File

@ -0,0 +1,82 @@
var requirejs = require('requirejs');
//var Mocha = require('mocha');
requirejs.config({
paths: {
"tests": "../tests",
"src": "../src",
"spec": "../tests/spec",
"bugs": "../tests/bugs",
"util": "../tests/lib/test-utils",
"Filer": "../dist/filer"
},
baseUrl: "./lib",
optimize: "none",
shim: {
// TextEncoder and TextDecoder shims. encoding-indexes must get loaded first,
// and we use a fake one for reduced size, since we only care about utf8.
"encoding": {
deps: ["encoding-indexes-shim"]
}
//,
// "mocha": {
// init: function() {
// this.mocha = new Mocha();
// this.mocha.setup("bdd").timeout(5000).slow(250);
// this.mocha.setup("bdd");
// GLOBAL.describe = mocha.describe;
// return this.mocha;
// }
// }
},
nodeRequire: require
});
GLOBAL.window = GLOBAL;
GLOBAL.expect = require('chai').expect;
console.log('here 1');
describe("one test", function() {
it('should work', function(done){
require('assert').ok(true);
done();
});
});
//requirejs(function() {
requirejs(["tests/test-manifest"], function() {
console.log('here 2');
//console.dir(mocha);
describe("two test", function() {
it('should work', function(done){
require('assert').ok(true);
done();
});
});
console.log('here 3');
// mocha.run(function() {
// console.log('running');
// });
console.log('here 4');
/**
mocha.run(function() {
console.log('here 4');
}).on('fail', function(test) {
console.log('fail', test);
}).on('pass', function(test) {
console.log('pass', test);
});
});
**/
});
//setTimeout(function(){}, 3000);