bump jest and make tests pass

This commit is contained in:
Louis Hache committed 2020-11-13 19:11:55 +01:00
1 parent d28dc26fa3
commit 4f58d166b7
5769 files changed
+856618 -394571

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
'use strict';
const fs = require('fs');
let isDocker;
function hasDockerEnv() {
try {
fs.statSync('/.dockerenv');
return true;
} catch (_) {
return false;
}
}
function hasDockerCGroup() {
try {
return fs.readFileSync('/proc/self/cgroup', 'utf8').includes('docker');
} catch (_) {
return false;
}
}
module.exports = () => {
if (isDocker === undefined) {
isDocker = hasDockerEnv() || hasDockerCGroup();
}
return isDocker;
};