diff --git a/lib/util.js b/lib/util.js index c089af64..df506e01 100644 --- a/lib/util.js +++ b/lib/util.js @@ -1,11 +1,12 @@ 'use strict'; -const StatusCodeError = require('request-promise/errors').StatusCodeError; const _ = require('lodash'); const request = require('request-promise'); +const {StatusCodeError} = require('request-promise/errors'); const config = require('./config'); const errors = require('./errors'); +const {version} = require('../package.json'); const util = {}; @@ -52,7 +53,7 @@ util.getUrl = function(id, endpoint) { util.request = request.defaults({ json: true, headers: { - 'User-Agent': `smartcar-node-sdk:${config.version}`, + 'User-Agent': `smartcar-node-sdk:${version}`, }, }); diff --git a/test/lib/vehicle.js b/test/lib/vehicle.js index 5a1f3913..2af5d9bc 100644 --- a/test/lib/vehicle.js +++ b/test/lib/vehicle.js @@ -5,11 +5,11 @@ const nock = require('nock'); const test = require('ava'); const Vehicle = require('../../lib/vehicle'); -const config = require('../../lib/config'); +const {version} = require('../../package.json'); const VID = 'ada7207c-3c0a-4027-a47f-6215ce6f7b93'; const TOKEN = '9ad942c6-32b8-4af2-ada6-5e8ecdbad9c2'; -const USER_AGENT = `smartcar-node-sdk:${config.version}`; +const USER_AGENT = `smartcar-node-sdk:${version}`; const vehicle = new Vehicle(VID, TOKEN);