Stop using __dirname in requires

This commit is contained in:
Daniel García Aubert 2019-10-07 10:55:26 +02:00
parent e8cff194fc
commit 98f3e8159e
14 changed files with 26 additions and 26 deletions

View File

@ -7,7 +7,7 @@ var step = require('step');
var FastlyPurge = require('fastly-purge');
var _ = require('underscore');
var NamedMapsCacheEntry = require('../../../lib/cache/model/named-maps-entry');
var CartodbWindshaft = require(__dirname + '/../../../lib/server');
var CartodbWindshaft = require('../../../lib/server');
var nock = require('nock');
describe('templates surrogate keys', function() {

View File

@ -3,9 +3,9 @@
var assert = require('../support/assert');
var step = require('step');
var LayergroupToken = require('../../lib/models/layergroup-token');
var testHelper = require(__dirname + '/../support/test-helper');
var CartodbWindshaft = require(__dirname + '/../../lib/server');
var serverOptions = require(__dirname + '/../../lib/server-options');
var testHelper = require('../support/test-helper');
var CartodbWindshaft = require('../../lib/server');
var serverOptions = require('../../lib/server-options');
describe('dynamic styling for named maps', function() {
var server;

View File

@ -1,8 +1,8 @@
'use strict';
var assert = require('../support/assert');
var CartodbWindshaft = require(__dirname + '/../../lib/server');
var serverOptions = require(__dirname + '/../../lib/server-options');
var CartodbWindshaft = require('../../lib/server');
var serverOptions = require('../../lib/server-options');
describe('error with context', function () {
var server;

View File

@ -1,6 +1,6 @@
'use strict';
require(__dirname + '/../support/test-helper');
require('../support/test-helper');
var fs = require('fs');

View File

@ -10,7 +10,7 @@ var redis_stats_db = 5;
var mapnik = require('windshaft').mapnik;
var semver = require('semver');
var helper = require(__dirname + '/../support/test-helper');
var helper = require('../support/test-helper');
var LayergroupToken = require('../../lib/models/layergroup-token');
var windshaft_fixtures = __dirname + '/../../node_modules/windshaft/test/fixtures';

View File

@ -4,8 +4,8 @@ var step = require('step');
var test_helper = require('../support/test-helper');
var assert = require('../support/assert');
var CartodbWindshaft = require(__dirname + '/../../lib/server');
var serverOptions = require(__dirname + '/../../lib/server-options');
var CartodbWindshaft = require('../../lib/server');
var serverOptions = require('../../lib/server-options');
var RedisPool = require('redis-mpool');
var TemplateMaps = require('../../lib/backends/template-maps');

View File

@ -3,8 +3,8 @@
var test_helper = require('../support/test-helper');
var assert = require('../support/assert');
var CartodbWindshaft = require(__dirname + '/../../lib/server');
var serverOptions = require(__dirname + '/../../lib/server-options');
var CartodbWindshaft = require('../../lib/server');
var serverOptions = require('../../lib/server-options');
var LayergroupToken = require('../../lib/models/layergroup-token');

View File

@ -6,8 +6,8 @@ var querystring = require('querystring');
var assert = require('../support/assert');
var mapnik = require('windshaft').mapnik;
var CartodbWindshaft = require(__dirname + '/../../lib/server');
var serverOptions = require(__dirname + '/../../lib/server-options');
var CartodbWindshaft = require('../../lib/server');
var serverOptions = require('../../lib/server-options');
var TemplateMaps = require('../../lib/backends/template-maps');
var NamedMapsCacheEntry = require('../../lib/cache/model/named-maps-entry');

View File

@ -6,8 +6,8 @@ var querystring = require('querystring');
var assert = require('../support/assert');
var mapnik = require('windshaft').mapnik;
var CartodbWindshaft = require(__dirname + '/../../lib/server');
var serverOptions = require(__dirname + '/../../lib/server-options');
var CartodbWindshaft = require('../../lib/server');
var serverOptions = require('../../lib/server-options');
var TemplateMaps = require('../../lib/backends/template-maps');
var NamedMapsCacheEntry = require('../../lib/cache/model/named-maps-entry');

View File

@ -3,8 +3,8 @@
var test_helper = require('../support/test-helper');
var assert = require('../support/assert');
var CartodbWindshaft = require(__dirname + '/../../lib/server');
var serverOptions = require(__dirname + '/../../lib/server-options');
var CartodbWindshaft = require('../../lib/server');
var serverOptions = require('../../lib/server-options');
var LayergroupToken = require('../../lib/models/layergroup-token');

View File

@ -3,8 +3,8 @@
var test_helper = require('../support/test-helper');
var assert = require('../support/assert');
var CartodbWindshaft = require(__dirname + '/../../lib/server');
var serverOptions = require(__dirname + '/../../lib/server-options');
var CartodbWindshaft = require('../../lib/server');
var serverOptions = require('../../lib/server-options');
var LayergroupToken = require('../../lib/models/layergroup-token');

View File

@ -5,8 +5,8 @@ var assert = require('../support/assert');
const helper = require('../support/test-helper');
var TestClient = require('../support/test-client');
const LayergroupToken = require('../../lib/models/layergroup-token');
const CartodbWindshaft = require(__dirname + '/../../lib/server');
const serverOptions = require(__dirname + '/../../lib/server-options');
const CartodbWindshaft = require('../../lib/server');
const serverOptions = require('../../lib/server-options');
describe('regressions', function() {

View File

@ -18,10 +18,10 @@ process.env.PGHOST = 'fake';
var fs = require('fs');
var http = require('http');
var helper = require(__dirname + '/../support/test-helper');
var helper = require('../support/test-helper');
var CartodbWindshaft = require(__dirname + '/../../lib/server');
var serverOptions = require(__dirname + '/../../lib/server-options');
var CartodbWindshaft = require('../../lib/server');
var serverOptions = require('../../lib/server-options');
var LayergroupToken = require('../../lib/models/layergroup-token');

View File

@ -18,7 +18,7 @@ var log4js = require('log4js');
const setICUEnvVariable = require('../../lib/utils/icu-data-env-setter');
// set environment specific variables
global.environment = require(__dirname + '/../../config/environments/test');
global.environment = require('../../config/environments/test');
global.environment.name = 'test';
process.env.NODE_ENV = 'test';