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 David Humphrey
parent 14c584ab8e
commit 4b092a1415
3 changed files with 86 additions and 2 deletions

View File

@ -29,6 +29,8 @@
"grunt-contrib-concat": "~0.1.3",
"grunt-contrib-jshint": "~0.7.1",
"grunt-mocha": "0.4.10",
"grunt-contrib-connect": "~0.7.1"
"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);