From 60d2cc0a4fc7c6c7d22f6b99dfcdef1742f7c261 Mon Sep 17 00:00:00 2001 From: Eneko Lakasta Date: Wed, 10 Jan 2018 21:06:47 +0100 Subject: [PATCH] set ICU_DATA env variable also in tests --- test/support/test_helper.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/support/test_helper.js b/test/support/test_helper.js index 96a109ff..57011698 100644 --- a/test/support/test_helper.js +++ b/test/support/test_helper.js @@ -21,6 +21,17 @@ global.environment = require(__dirname + '/../../config/environments/test'); global.environment.name = 'test'; process.env.NODE_ENV = 'test'; +// See https://github.com/CartoDB/support/issues/984 +// CartoCSS properties text-wrap-width/text-wrap-character not working +function setICUEnvVariable() { + const glob = require('glob'); + const path = require('path'); + let directory = glob.sync(path.join(__dirname, '../..', '/node_modules/mapnik/lib/binding/*/share/mapnik/icu/')); + if (directory && directory.length > 0) { + process.env.ICU_DATA = directory[0]; + } +} +setICUEnvVariable(); // don't output logs in test environment to reduce noise log4js.configure({ appenders: [] });