Get tests to run

This commit is contained in:
David Humphrey (:humph) david.humphrey@senecacollege.ca 2014-05-23 16:53:50 -04:00
parent 38627f95d6
commit 4ab41c4aea
52 changed files with 4099 additions and 4107 deletions

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('trailing slashes in path names, issue 105', function() {
beforeEach(util.setup);
@ -32,4 +34,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.writeFile truncation - issue 106', function() {
beforeEach(util.setup);
@ -28,4 +30,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -52,7 +52,7 @@
}
// Allow passing FS flags on query string
var flags = global.filerArgs && global.filerArgs.flags) ?
var flags = global.filerArgs && global.filerArgs.flags ?
global.filerArgs.flags : 'FORMAT';
// Create a file system and wait for it to get setup

View File

@ -1,4 +1,5 @@
define(["Filer"], function(Filer) {
var Filer = require('../..');
var expect = require('chai').expect;
describe("Filer.Errors", function() {
it("has expected errors", function() {
@ -133,4 +134,3 @@ define(["Filer"], function(Filer) {
expect(Filer.Errors[1002]).to.equal(Filer.Errors.ENOATTR);
});
});
});

View File

@ -1,4 +1,5 @@
define(["Filer"], function(Filer) {
var Filer = require('../..');
var expect = require('chai');
describe("Filer", function() {
it("is defined", function() {
@ -9,5 +10,3 @@ define(["Filer"], function(Filer) {
expect(typeof Filer.FileSystem).to.equal('function');
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.appendFile', function() {
beforeEach(function(done) {
@ -126,4 +128,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.close', function() {
beforeEach(util.setup);
@ -26,5 +28,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.exists', function() {
beforeEach(util.setup);
@ -56,4 +58,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.link', function() {
beforeEach(util.setup);
@ -68,5 +70,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.lseek', function() {
beforeEach(util.setup);
@ -160,5 +162,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.lstat', function() {
beforeEach(util.setup);
@ -47,5 +49,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.mkdir', function() {
beforeEach(util.setup);
@ -45,5 +47,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,7 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.mknod', function() {
beforeEach(util.setup);
afterEach(util.cleanup);
@ -75,6 +78,4 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});
});

View File

@ -1,4 +1,7 @@
define(["Filer", "util", "src/constants"], function(Filer, util, constants) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
var constants = require('../../src/constants.js');
describe('fs.open', function() {
beforeEach(util.setup);
@ -31,7 +34,6 @@ define(["Filer", "util", "src/constants"], function(Filer, util, constants) {
});
});
it('should return an error when flagged for write and the path is a directory', function(done) {
var fs = util.fs();
@ -105,5 +107,3 @@ define(["Filer", "util", "src/constants"], function(Filer, util, constants) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.read', function() {
beforeEach(util.setup);
@ -58,5 +60,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.readdir', function() {
beforeEach(util.setup);
@ -54,5 +56,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.readlink', function() {
beforeEach(util.setup);
@ -43,5 +45,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.rename', function() {
beforeEach(util.setup);
@ -46,5 +48,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.rmdir', function() {
beforeEach(util.setup);
@ -97,5 +99,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe("fs", function() {
beforeEach(util.setup);
@ -20,5 +22,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.stat', function() {
beforeEach(util.setup);
@ -91,5 +93,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.stats', function() {
describe('#isFile()', function() {
@ -244,4 +246,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.symlink', function() {
beforeEach(util.setup);
@ -43,5 +45,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.truncate', function() {
beforeEach(util.setup);
@ -186,4 +188,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.unlink', function() {
beforeEach(util.setup);
@ -81,5 +83,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.utimes', function() {
beforeEach(util.setup);
@ -176,4 +178,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.watch', function() {
beforeEach(util.setup);
@ -39,5 +41,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.write', function() {
beforeEach(util.setup);
@ -58,5 +60,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.writeFile, fs.readFile', function() {
beforeEach(util.setup);
@ -100,5 +102,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('fs.xattr', function() {
beforeEach(util.setup);
@ -390,4 +392,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,5 @@
define(['../../src/network'], function(network) {
var network = require('../../src/network.js');
var expect = require('chai').expect;
describe('Network download tool', function() {
var uri;
@ -63,4 +64,3 @@ define(['../../src/network'], function(network) {
});
});
});
});

View File

@ -1,7 +1,8 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../../..');
var util = require('../../../lib/test-utils.js');
var expect = require('chai').expect;
describe("node.js tests: https://github.com/joyent/node/blob/master/test/simple/test-fs-mkdir.js", function() {
beforeEach(util.setup);
afterEach(util.cleanup);
@ -37,5 +38,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,7 +1,8 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../../..');
var util = require('../../../lib/test-utils.js');
var expect = require('chai').expect;
describe("node.js tests: https://github.com/joyent/node/blob/master/test/simple/test-fs-null-bytes.js", function() {
beforeEach(util.setup);
afterEach(util.cleanup);
@ -59,4 +60,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,13 +1,13 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../../..');
var util = require('../../../lib/test-utils.js');
var expect = require('chai').expect;
/**
* NOTE: unlike node.js, which either doesn't give filenames (e.g., in case of
* fd vs. path) for events, or gives only a portion thereof (e.g., basname),
* we give full, abs paths always.
*/
describe("node.js tests: https://github.com/joyent/node/blob/master/test/simple/test-fs-watch-recursive.js", function() {
beforeEach(util.setup);
afterEach(util.cleanup);
@ -33,6 +33,4 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});
});

View File

@ -1,16 +1,16 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../../..');
var util = require('../../../lib/test-utils.js');
var expect = require('chai').expect;
/**
* NOTE: unlike node.js, which either doesn't give filenames (e.g., in case of
* fd vs. path) for events, or gives only a portion thereof (e.g., basname),
* we give full, abs paths always.
*/
var filenameOne = '/watch.txt';
var filenameTwo = '/hasOwnProperty';
describe("node.js tests: https://github.com/joyent/node/blob/master/test/simple/test-fs-watch.js", function() {
beforeEach(util.setup);
afterEach(util.cleanup);
@ -71,4 +71,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('path resolution', function() {
beforeEach(util.setup);
@ -222,5 +224,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,15 +1,10 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../..');
var util = require('../../lib/test-utils.js');
var expect = require('chai').expect;
if(!Filer.FileSystem.providers.IndexedDB.isSupported()) {
console.log("Skipping Filer.FileSystem.providers.IndexedDB tests, since IndexedDB isn't supported.");
return;
}
if(navigator.userAgent.indexOf('PhantomJS') > -1) {
console.log("Skipping Filer.FileSystem.providers.IndexedDB tests, since PhantomJS doesn't support it.");
return;
}
} else {
describe("Filer.FileSystem.providers.IndexedDB", function() {
it("is supported -- if it isn't, none of these tests can run.", function() {
expect(Filer.FileSystem.providers.IndexedDB.isSupported()).to.be.true;
@ -150,4 +145,4 @@ define(["Filer", "util"], function(Filer, util) {
});
});
}

View File

@ -1,4 +1,5 @@
define(["Filer"], function(Filer) {
var Filer = require('../../..');
var expect = require('chai').expect;
describe("Filer.FileSystem.providers.Memory", function() {
it("is supported -- if it isn't, none of these tests can run.", function() {
@ -110,5 +111,3 @@ define(["Filer"], function(Filer) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer"], function(Filer) {
var Filer = require('../../..');
var expect = require('chai').expect;
describe("Filer.FileSystem.providers", function() {
it("is defined", function() {
expect(Filer.FileSystem.providers).to.exist;
@ -24,4 +26,3 @@ define(["Filer"], function(Filer) {
expect(Filer.FileSystem.providers.Fallback).to.be.a('function');
});
});
});

View File

@ -1,15 +1,10 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../..');
var util = require('../../lib/test-utils.js');
var expect = require('chai').expect;
if(!Filer.FileSystem.providers.WebSQL.isSupported()) {
console.log("Skipping Filer.FileSystem.providers.WebSQL tests, since WebSQL isn't supported.");
return;
}
if(navigator.userAgent.indexOf('PhantomJS') > -1) {
console.log("Skipping Filer.FileSystem.providers.WebSQL tests, since PhantomJS doesn't support it.");
return;
}
} else {
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;
@ -145,4 +140,4 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
}

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../..');
var util = require('../../lib/test-utils.js');
var expect = require('chai').expect;
describe('FileSystemShell.cat', function() {
beforeEach(util.setup);
@ -79,6 +81,4 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});
});

View File

@ -1,4 +1,5 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../..');
var util = require('../../lib/test-utils.js');
describe('FileSystemShell.cd', function() {
beforeEach(util.setup);
@ -118,6 +119,4 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../..');
var util = require('../../lib/test-utils.js');
var expect = require('chai').expect;
describe('FileSystemShell.env', function() {
beforeEach(util.setup);
@ -108,6 +110,4 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../..');
var util = require('../../lib/test-utils.js');
var expect = require('chai').expect;
describe('FileSystemShell.exec', function() {
beforeEach(util.setup);
@ -29,5 +31,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../..');
var util = require('../../lib/test-utils.js');
var expect = require('chai').expect;
describe('FileSystemShell.ls', function() {
beforeEach(util.setup);
@ -182,6 +184,4 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../..');
var util = require('../../lib/test-utils.js');
var expect = require('chai').expect;
describe('FileSystemShell.mkdirp', function() {
beforeEach(util.setup);
@ -94,4 +96,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../..');
var util = require('../../lib/test-utils.js');
var expect = require('chai').expect;
describe('FileSystemShell.rm', function() {
beforeEach(util.setup);
@ -133,6 +135,4 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../..');
var util = require('../../lib/test-utils.js');
var expect = require('chai').expect;
function getTimes(fs, path, callback) {
fs.stat(path, function(error, stats) {
@ -99,5 +101,3 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../..');
var util = require('../../lib/test-utils.js');
var expect = require('chai').expect;
describe('FileSystemShell.wget', function() {
beforeEach(util.setup);
@ -90,7 +92,4 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../../..');
var util = require('../../lib/test-utils.js');
var expect = require('chai').expect;
describe('FileSystemShell.zip() and unzip()', function() {
beforeEach(util.setup);
@ -183,7 +185,6 @@ define(["Filer", "util"], function(Filer, util) {
confirmFile('test-dir/test-file2.txt', function() {
done();
});});});});});
});
});
});
@ -281,6 +282,4 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('node times (atime, mtime, ctime) with mount flags', function() {
@ -101,6 +103,4 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});
});

View File

@ -1,4 +1,6 @@
define(["Filer", "util"], function(Filer, util) {
var Filer = require('../..');
var util = require('../lib/test-utils.js');
var expect = require('chai').expect;
describe('node times (atime, mtime, ctime)', function() {
beforeEach(util.setup);
@ -617,6 +619,4 @@ define(["Filer", "util"], function(Filer, util) {
});
});
});
});
});