Turn on jshint and mocha/phantomjs tests with TravisCI. Fixes #48.

This commit is contained in:
David Humphrey (:humph) david.humphrey@senecacollege.ca 2014-02-17 11:28:04 -05:00
parent a0ef904f9a
commit d2f743511e
4 changed files with 10 additions and 3 deletions

1
.travis.yml Normal file
View File

@ -0,0 +1 @@
script: grunt test

View File

@ -8,7 +8,8 @@
"bugs": "https://github.com/js-platform/filer/issues",
"license": "BSD",
"scripts": {
"postinstall": "./node_modules/.bin/bower install"
"postinstall": "./node_modules/.bin/bower install",
"test": "grunt test"
},
"repository": {
"type": "git",

View File

@ -172,8 +172,8 @@ define(["Filer", "util"], function(Filer, util) {
expect(error).not.to.exist;
// Note: testing estimation as time may differ by a couple of milliseconds
// This number should be increased if tests are on slow systems
expect(now - stat.atime).to.be.below(25);
expect(now - stat.mtime).to.be.below(25);
expect(now - stat.atime).to.be.below(75);
expect(now - stat.mtime).to.be.below(75);
done();
});
});

View File

@ -5,6 +5,11 @@ define(["Filer", "util"], function(Filer, util) {
return;
}
if(navigator.userAgent.indexOf('PhantomJS') > -1) {
console.log("Skipping Filer.FileSystem.providers.WebSQL tests, since PhantomJS doesn't support it.");
return;
}
describe("Filer.FileSystem.providers.WebSQL", function() {
it("is supported -- if it isn't, none of these tests can run.", function() {
expect(Filer.FileSystem.providers.WebSQL.isSupported()).to.be.true;