From 527fc07102a1848af28a6256e624b132aad3ea39 Mon Sep 17 00:00:00 2001 From: Dmitriy Nevzorov Date: Mon, 5 Sep 2016 13:30:17 +0200 Subject: [PATCH] update dependencies & fix tests --- .babelrc | 4 +++- CHANGELOG.md | 0 babelhook.js | 4 +--- package.json | 13 ++++++++----- test/index.js | 4 +++- 5 files changed, 15 insertions(+), 10 deletions(-) delete mode 100644 CHANGELOG.md diff --git a/.babelrc b/.babelrc index 12606a3..3c078e9 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,5 @@ { - "stage": 0 + "presets": [ + "es2015" + ] } diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index e69de29..0000000 diff --git a/babelhook.js b/babelhook.js index d407dc7..db19606 100644 --- a/babelhook.js +++ b/babelhook.js @@ -1,3 +1 @@ -require("babel/register")({ - stage: 0 -}); +require("babel-register"); diff --git a/package.json b/package.json index 17f5bbf..0de3626 100644 --- a/package.json +++ b/package.json @@ -19,17 +19,20 @@ ], "dependencies": { "aws-signature-v4": "^1.0.1", - "core-js": "^0.9.13", - "mqtt": "^1.12.0", - "websocket-stream": "^3.2.1" + "core-js": "^2.4.1", + "mqtt": "^1.14.1", + "websocket-stream": "^3.3.0" }, "peerDependencies": {}, "optionalDependencies": {}, "devDependencies": { - "babel": "^5.4.7", + "babel": "^6.5.2", + "babel-preset-es2015": "^6.14.0", + "babel-register": "^6.14.0", "chai": "^3.5.0", "chai-string": "^1.2.0", - "mocha": "^2.2.1" + "mocha": "^3.0.2", + "moment": "^2.14.1" }, "scripts": { "compile": "babel -e -d lib/ src/", diff --git a/test/index.js b/test/index.js index 7807e14..116d7c3 100644 --- a/test/index.js +++ b/test/index.js @@ -3,6 +3,7 @@ import AWSMqtt from '../src'; import MqttClient from 'mqtt/lib/client'; import chai from 'chai'; import chaiString from 'chai-string'; +import moment from 'moment'; chai.use(chaiString); const expect = chai.expect; @@ -28,7 +29,8 @@ describe("AWSMqtt", () => { }); it("should contain correct amz credentials", () => { - expect(awsMqttClient.stream.socket.url).to.contain('X-Amz-Credential=ASIAJKQ5TEVEKOEAUXCQ%2F20160711%2Feu-west-1%2Fiotdevicegateway%2Faws4_request'); + const date = moment().format('YYYYMMDD'); + expect(awsMqttClient.stream.socket.url).to.contain(`X-Amz-Credential=ASIAJKQ5TEVEKOEAUXCQ%2F${date}%2Feu-west-1%2Fiotdevicegateway%2Faws4_request`); }); it("should contain security token", () => {