We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e23c62e commit 90a9d35Copy full SHA for 90a9d35
postinstall.js
@@ -8,7 +8,12 @@ It helps to skip timeout setup `jasmine.DEFAULT_TIMEOUT_INTERVAL = 60000;`
8
when first test run hits MongoDB binary downloading to the cache.
9
*/
10
11
-if (require.resolve('./lib/util/MongoBinary')) {
+function isModuleExists(name) {
12
+ try { return !!require.resolve(name); }
13
+ catch(e) { return false }
14
+}
15
+
16
+if (isModuleExists('./lib/util/MongoBinary')) {
17
const MongoBinary = require('./lib/util/MongoBinary').default;
18
19
console.log('mongodb-memory-server: checking MongoDB binaries cache...');
0 commit comments