Rahul Pratap c80992b6bf
Update prettier config for the project. (#16303)
* Update prettier config for the project.

* Add prettier to make lint-fix.
2023-06-19 19:09:12 +05:30

29 lines
679 B
JavaScript

var Mocks = require('../target/mocks/mocks.js');
var Module = require('module');
process.env.TZ = 'Etc/UTC';
const originalLoader = Module._load;
/*
Hook `require` so that RN abuse of require does not break when running tests in nodejs.
*/
Module._load = function hookedLoader(request, parent, isMain) {
if (request.match(/.jpeg|.jpg|.png|.mp4$/)) {
return { uri: request };
}
return originalLoader(request, parent, isMain);
};
var originalRequire = Module.prototype.require;
Module.prototype.require = function (req) {
module = Mocks.mocks(req);
if (module == null) {
return originalRequire.apply(this, arguments);
} else {
return module;
}
};