Skip to content

Commit

Permalink
happy coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
juergba committed Feb 22, 2020
1 parent 86d59f9 commit 5731b7a
Showing 1 changed file with 7 additions and 20 deletions.
27 changes: 7 additions & 20 deletions lib/utils.js
Expand Up @@ -843,26 +843,13 @@ exports.defineConstants = function(obj) {
* @returns {Boolean} whether the current version of Node.JS supports ES Modules in a way that is compatible with Mocha
*/
exports.supportsEsModules = function() {
if (typeof document !== 'undefined') {
return false;
}
if (
typeof process !== 'object' ||
!process.versions ||
!process.versions.node
) {
return false;
}
var versionFields = process.versions.node.split('.');
var major = +versionFields[0];
var minor = +versionFields[1];
if (!process.browser && process.versions && process.versions.node) {
var versionFields = process.versions.node.split('.');
var major = +versionFields[0];
var minor = +versionFields[1];

if (major >= 13) {
return true;
}
if (major < 12) {
return false;
if (major >= 13 || (major === 12 && minor >= 11)) {
return true;
}
}
// major === 12
return minor >= 11;
};

0 comments on commit 5731b7a

Please sign in to comment.