mirror of
https://github.com/status-im/status-react.git
synced 2025-01-09 18:46:19 +00:00
15 lines
347 B
JavaScript
15 lines
347 B
JavaScript
|
const m = require('module');
|
||
|
const originalLoader = m._load;
|
||
|
|
||
|
/*
|
||
|
Hook `require` so that RN abuse of require does not break when running tests in nodejs.
|
||
|
*/
|
||
|
|
||
|
m._load = function hookedLoader(request, parent, isMain) {
|
||
|
if (request.match(/.jpeg|.jpg|.png$/)) {
|
||
|
return { uri: request };
|
||
|
}
|
||
|
|
||
|
return originalLoader(request, parent, isMain);
|
||
|
};
|