Merge pull request #115 from humphd/issue48

Turn on jshint and mocha/phantomjs tests with TravisCI. Fixes #48.
This commit is contained in:
Alan K 2014-02-17 18:04:43 -05:00
commit a14ad057e8
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", "bugs": "https://github.com/js-platform/filer/issues",
"license": "BSD", "license": "BSD",
"scripts": { "scripts": {
"postinstall": "./node_modules/.bin/bower install" "postinstall": "./node_modules/.bin/bower install",
"test": "grunt test"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

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

View File

@ -5,6 +5,11 @@ define(["Filer", "util"], function(Filer, util) {
return; 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() { describe("Filer.FileSystem.providers.WebSQL", function() {
it("is supported -- if it isn't, none of these tests can run.", function() { it("is supported -- if it isn't, none of these tests can run.", function() {
expect(Filer.FileSystem.providers.WebSQL.isSupported()).to.be.true; expect(Filer.FileSystem.providers.WebSQL.isSupported()).to.be.true;