Update package.json + tests/ to support browser property for bundlers, delete old useless tests for AMD
This commit is contained in:
parent
c15145cc03
commit
65bbc17ccb
|
@ -13084,6 +13084,12 @@
|
|||
"resolve-from": "1.0.1"
|
||||
}
|
||||
},
|
||||
"requirejs": {
|
||||
"version": "2.3.5",
|
||||
"resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.5.tgz",
|
||||
"integrity": "sha512-svnO+aNcR/an9Dpi44C7KSAy5fFGLtmPbaaCeQaklUz8BQhS64tWWIIlvEA5jrWICzlO/X9KSzSeXFnZdBu8nw==",
|
||||
"dev": true
|
||||
},
|
||||
"resolve": {
|
||||
"version": "1.8.1",
|
||||
"resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz",
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
"chai": "^4.1.2",
|
||||
"eslint": "^5.0.1",
|
||||
"mocha": "^5.2.0",
|
||||
"parcel-bundler": "^1.9.3"
|
||||
"parcel-bundler": "^1.9.3",
|
||||
"requirejs": "^2.3.5"
|
||||
},
|
||||
"main": "./src/index.js"
|
||||
"main": "./src/index.js",
|
||||
"browser": "./dist/filer.min.js"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
/**
|
||||
* https://github.com/js-platform/filer/pull/225
|
||||
*
|
||||
* NOTE: this test has to be run outside the browserify step,
|
||||
* since combinining require for node.js/browserify builds with
|
||||
* r.js doesn't work.
|
||||
*/
|
||||
|
||||
var requirejs = require('requirejs');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
// browser-request assumes access to XHR
|
||||
GLOBAL.XMLHttpRequest = {};
|
||||
|
||||
describe('require.js should be able to use built Filer, issue 225', function() {
|
||||
|
||||
it('should properly load Filer as an AMD module, with Buffer included', function(done) {
|
||||
requirejs.config({
|
||||
baseUrl: __dirname,
|
||||
paths: {
|
||||
"filer": "../../dist/filer-issue225"
|
||||
},
|
||||
nodeRequire: require
|
||||
});
|
||||
|
||||
requirejs(["filer"], function(Filer) {
|
||||
expect(Filer).to.exist;
|
||||
expect(Filer.Buffer).to.exist;
|
||||
|
||||
var fs = new Filer.FileSystem({provider: new Filer.FileSystem.providers.Memory()});
|
||||
|
||||
var buf = new Filer.Buffer([1, 2, 3]);
|
||||
fs.writeFile('/file', buf, function(err) {
|
||||
expect(err).not.to.exist;
|
||||
|
||||
fs.readFile('/file', function(err, data) {
|
||||
expect(err).not.to.exist;
|
||||
expect(data).to.deep.equal(buf);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var Filer = require('../../src');
|
||||
var expect = require('chai').expect;
|
||||
var setImmediate = require('../../lib/async.js').setImmediate;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Path = require('../..').Path;
|
||||
var Path = require('../../src').Path;
|
||||
var expect = require('chai').expect;
|
||||
|
||||
describe('Path.resolve does not work, issue357', function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
var async = require('../../lib/async.js');
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
<script src="../node_modules/chai/chai.js"></script>
|
||||
<script src="../node_modules/mocha/mocha.js"></script>
|
||||
|
||||
<script>
|
||||
mocha.setup('bdd').timeout(5000).slow(250);;
|
||||
|
||||
|
@ -19,7 +20,8 @@
|
|||
mocha.run();
|
||||
};
|
||||
</script>
|
||||
<script src="./index.js"></script>
|
||||
|
||||
<!-- Add any new tests to `tests/index.js` -->
|
||||
<script src="./index.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -66,7 +66,6 @@ require("./spec/node-js/simple/test-fs-watch");
|
|||
require("./spec/node-js/simple/test-fs-watch-recursive");
|
||||
|
||||
// Regressions, Bugs
|
||||
// NOTE: bugs/issue225.js has to be run outside this step, see gruntfile.js
|
||||
require("./bugs/issue105");
|
||||
require("./bugs/issue106");
|
||||
require("./bugs/issue239");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require("../..");
|
||||
var Filer = require('../../src');
|
||||
|
||||
var indexedDB = global.indexedDB ||
|
||||
global.mozIndexedDB ||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
|
||||
function MemoryTestProvider(name) {
|
||||
var that = this;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var IndexedDBTestProvider = require('./indexeddb.js');
|
||||
var WebSQLTestProvider = require('./websql.js');
|
||||
var MemoryTestProvider = require('./memory.js');
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
|
||||
var needsCleanup = [];
|
||||
if(global.addEventListener) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
describe("Filer.Errors", function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
describe("Filer", function() {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
var constants = require('../../src/constants.js');
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Path = Filer.Path;
|
||||
var Path = require('../../src').Path;
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
define(["Filer", "util"], function(Filer, util) {
|
||||
|
||||
describe('Nodejs compatability', function() {
|
||||
beforeEach(util.setup);
|
||||
afterEach(util.cleanup);
|
||||
|
||||
it('module should be requireable', function() {
|
||||
expect(function() {
|
||||
var Filer = require('../../dist/filer_node.js');
|
||||
}).to.not.throwError;
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../../../..');
|
||||
var util = require('../../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../../../..');
|
||||
var util = require('../../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../../../..');
|
||||
var util = require('../../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../../../..');
|
||||
var util = require('../../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Buffer = require('../../..').Buffer;
|
||||
var Buffer = require('../../../src').Buffer;
|
||||
var util = require('../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../../..');
|
||||
var Filer = require('../../../src');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
describe("Filer.FileSystem.providers", function() {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../../..');
|
||||
var util = require('../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../../..');
|
||||
var util = require('../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../../..');
|
||||
var util = require('../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../../..');
|
||||
var util = require('../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../../..');
|
||||
var util = require('../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../../..');
|
||||
var util = require('../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../../..');
|
||||
var util = require('../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../../..');
|
||||
var util = require('../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var Filer = require('../../..');
|
||||
var util = require('../../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Filer = require('../..');
|
||||
var Filer = require('../../src');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
var Path = require('../..').Path;
|
||||
var Path = require('../../src').Path;
|
||||
var expect = require('chai').expect;
|
||||
|
||||
describe('Path.normalize and trailing slashes', function() {
|
||||
|
|
Loading…
Reference in New Issue