From f9b6e92745c7ce8d12ab2155ce9f593d87afd444 Mon Sep 17 00:00:00 2001 From: Raul Marin Date: Thu, 12 Sep 2019 13:28:33 +0200 Subject: [PATCH] Stop throwing up warnings during testing Yeah, I test with different repos and branches. Big deal. Shut up. --- lib/cartodb/server.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/cartodb/server.js b/lib/cartodb/server.js index ad998ef9..a200b062 100644 --- a/lib/cartodb/server.js +++ b/lib/cartodb/server.js @@ -79,22 +79,22 @@ function getAndValidateVersions(options) { windshaft_cartodb: packageDefinition.version }; - var dependenciesToValidate = ['camshaft', 'turbo-carto', 'windshaft']; - dependenciesToValidate.forEach(function(depName) { - var declaredDependencyVersion = declaredDependencies[depName]; - var installedDependencyVersion = installedDependenciesVersions[depName]; - if (!semver.satisfies(installedDependencyVersion,declaredDependencyVersion)) { - warn( - 'Dependency="%s" installed version="%s" does not match declared version="%s". Check your installation.', - depName, installedDependencyVersion, declaredDependencyVersion - ); - } - }); + if (process.env.NODE_ENV !== 'test') { + var dependenciesToValidate = ['camshaft', 'turbo-carto', 'windshaft']; + dependenciesToValidate.forEach(function(depName) { + var declaredDependencyVersion = declaredDependencies[depName]; + var installedDependencyVersion = installedDependenciesVersions[depName]; + if (!semver.satisfies(installedDependencyVersion,declaredDependencyVersion)) { + warn(`Dependency="${depName}" installed version="${installedDependencyVersion}" does ` + + `not match declared version="${declaredDependencyVersion}". Check your installation.`); + } + }); - // Be nice and warn if configured mapnik version is != installed mapnik version - if (windshaft.mapnik.versions.mapnik !== options.grainstore.mapnik_version) { - warn('WARNING: detected mapnik version (' + windshaft.mapnik.versions.mapnik + ')' + - ' != configured mapnik version (' + options.grainstore.mapnik_version + ')'); + // Be nice and warn if configured mapnik version is != installed mapnik version + if (windshaft.mapnik.versions.mapnik !== options.grainstore.mapnik_version) { + warn('WARNING: detected mapnik version (' + windshaft.mapnik.versions.mapnik + ')' + + ' != configured mapnik version (' + options.grainstore.mapnik_version + ')'); + } } return installedDependenciesVersions;