File tree Expand file tree Collapse file tree 5 files changed +15
-10
lines changed
Expand file tree Collapse file tree 5 files changed +15
-10
lines changed Original file line number Diff line number Diff line change 11{
2- "stage" : 0
2+ "presets" : [
3+ " es2015"
4+ ]
35}
Original file line number Diff line number Diff line change 1- require ( "babel/register" ) ( {
2- stage : 0
3- } ) ;
1+ require ( "babel-register" ) ;
Original file line number Diff line number Diff line change 1919 ],
2020 "dependencies" : {
2121 "aws-signature-v4" : " ^1.0.1" ,
22- "core-js" : " ^0.9.13 " ,
23- "mqtt" : " ^1.12.0 " ,
24- "websocket-stream" : " ^3.2.1 "
22+ "core-js" : " ^2.4.1 " ,
23+ "mqtt" : " ^1.14.1 " ,
24+ "websocket-stream" : " ^3.3.0 "
2525 },
2626 "peerDependencies" : {},
2727 "optionalDependencies" : {},
2828 "devDependencies" : {
29- "babel" : " ^5.4.7" ,
29+ "babel" : " ^6.5.2" ,
30+ "babel-preset-es2015" : " ^6.14.0" ,
31+ "babel-register" : " ^6.14.0" ,
3032 "chai" : " ^3.5.0" ,
3133 "chai-string" : " ^1.2.0" ,
32- "mocha" : " ^2.2.1"
34+ "mocha" : " ^3.0.2" ,
35+ "moment" : " ^2.14.1"
3336 },
3437 "scripts" : {
3538 "compile" : " babel -e -d lib/ src/" ,
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import AWSMqtt from '../src';
33import MqttClient from 'mqtt/lib/client' ;
44import chai from 'chai' ;
55import chaiString from 'chai-string' ;
6+ import moment from 'moment' ;
67chai . use ( chaiString ) ;
78const expect = chai . expect ;
89
@@ -28,7 +29,8 @@ describe("AWSMqtt", () => {
2829 } ) ;
2930
3031 it ( "should contain correct amz credentials" , ( ) => {
31- expect ( awsMqttClient . stream . socket . url ) . to . contain ( 'X-Amz-Credential=ASIAJKQ5TEVEKOEAUXCQ%2F20160711%2Feu-west-1%2Fiotdevicegateway%2Faws4_request' ) ;
32+ const date = moment ( ) . format ( 'YYYYMMDD' ) ;
33+ expect ( awsMqttClient . stream . socket . url ) . to . contain ( `X-Amz-Credential=ASIAJKQ5TEVEKOEAUXCQ%2F${ date } %2Feu-west-1%2Fiotdevicegateway%2Faws4_request` ) ;
3234 } ) ;
3335
3436 it ( "should contain security token" , ( ) => {
You can’t perform that action at this time.
0 commit comments