mirror of https://github.com/zulip/zulip.git
node test: Remove add_dependencies().
This commit is contained in:
parent
a1c5b0928e
commit
cdc1bf3d5e
|
@ -94,9 +94,6 @@ like the following toward the top of your test file:
|
||||||
> zrequire('stream_data');
|
> zrequire('stream_data');
|
||||||
> zrequire('Filter', 'js/filter');
|
> zrequire('Filter', 'js/filter');
|
||||||
|
|
||||||
(Deprecation note: you may see code where we use `add_dependencies` or
|
|
||||||
direct `require` statements. We should use `zrequire` instead.)
|
|
||||||
|
|
||||||
For modules that you want to completely stub out, please use a pattern
|
For modules that you want to completely stub out, please use a pattern
|
||||||
like this:
|
like this:
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
},
|
},
|
||||||
"globals": {
|
"globals": {
|
||||||
"assert": false,
|
"assert": false,
|
||||||
"add_dependencies": false,
|
|
||||||
"casper": false,
|
"casper": false,
|
||||||
"document": false,
|
"document": false,
|
||||||
"set_global": false,
|
"set_global": false,
|
||||||
|
|
|
@ -16,7 +16,6 @@ if (_.isEmpty(files)) {
|
||||||
var namespace = require('./namespace.js');
|
var namespace = require('./namespace.js');
|
||||||
global.set_global = namespace.set_global;
|
global.set_global = namespace.set_global;
|
||||||
global.patch_builtin = namespace.patch_builtin;
|
global.patch_builtin = namespace.patch_builtin;
|
||||||
global.add_dependencies = namespace.add_dependencies;
|
|
||||||
global.zrequire = namespace.zrequire;
|
global.zrequire = namespace.zrequire;
|
||||||
global.stub_out_jquery = namespace.stub_out_jquery;
|
global.stub_out_jquery = namespace.stub_out_jquery;
|
||||||
global.with_overrides = namespace.with_overrides;
|
global.with_overrides = namespace.with_overrides;
|
||||||
|
|
|
@ -30,12 +30,6 @@ exports.zrequire = function (name, fn) {
|
||||||
return obj;
|
return obj;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.add_dependencies = function (dct) {
|
|
||||||
_.each(dct, function (fn, name) {
|
|
||||||
exports.zrequire(name, fn);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.restore = function () {
|
exports.restore = function () {
|
||||||
dependencies.forEach(function (name) {
|
dependencies.forEach(function (name) {
|
||||||
delete global[name];
|
delete global[name];
|
||||||
|
|
Loading…
Reference in New Issue