14bf3184bb
* Use mocha, chai & sinon from the npm. As of sinon 2.0 sinon-as-promised is no longer required so it is removed * Tweak code to re-use the same loader with the same environment throghout the code * Introduce browserify step for testing tools that only provide node-compatible libraries (sinon, chai-as-promised) * Introduce copy step for test data to resolve multiple issues with tests depending on files not being symlinks * Re-introduce custom implementation of setTimeout to resolve issues with few tests * Re-introduce custom Bluebird Promises config & monkey patch
25 lines
No EOL
670 B
JavaScript
25 lines
No EOL
670 B
JavaScript
'use strict';
|
|
|
|
var EXPORTED_SYMBOLS = ['require'];
|
|
|
|
var require = (function() {
|
|
var { Loader, Require, Module } = Components.utils.import('resource://gre/modules/commonjs/toolkit/loader.js');
|
|
var requirer = Module('/', '/');
|
|
var _runningTimers = {};
|
|
|
|
var loader = Loader({
|
|
id: 'zotero/require',
|
|
paths: {
|
|
'': 'resource://zotero/',
|
|
},
|
|
globals: {
|
|
document: typeof document !== 'undefined' && document || {},
|
|
console: typeof console !== 'undefined' && console || {},
|
|
navigator: typeof navigator !== 'undefined' && navigator || {},
|
|
window,
|
|
Zotero: typeof Zotero !== 'undefined' && Zotero || {}
|
|
}
|
|
});
|
|
|
|
return Require(loader, requirer);
|
|
})(); |