twilio-notifications
Advanced tools
Comparing version 0.2.0-alpha.1 to 0.2.0-alpha.2
@@ -8,2 +8,3 @@ 'use strict'; | ||
const runSequence = require('run-sequence'); | ||
const exit = require('gulp-exit'); | ||
@@ -43,2 +44,6 @@ const cp = require('child_process'); | ||
index: 'test/unit/index.js' | ||
}, | ||
integration: { | ||
files: 'test/integration/**/*.js', | ||
index: 'test/integration/index.js' | ||
} | ||
@@ -73,2 +78,8 @@ }; | ||
gulp.task('integration-test', function() { | ||
return gulp.src(tests.integration.index, { read: false }) | ||
.pipe(mocha({ reporter: 'spec', timeout: 5000 })) | ||
.pipe(exit()); | ||
}); | ||
gulp.task('unit-test', ['istanbul-setup'], function() { | ||
@@ -75,0 +86,0 @@ return gulp.src(tests.unit.index, { read: false }) |
@@ -12,2 +12,5 @@ 'use strict'; | ||
const Twilsock = require('twilsock'); | ||
const Transport = require('twilio-transport'); | ||
function limit(fn, to, per) { | ||
@@ -39,6 +42,14 @@ // overflow since no token is passed to arguments | ||
options = options || {}; | ||
options.logLevel = options.logLevel || 'error'; | ||
log.setLevel(options.logLevel); | ||
const minTokenRefreshInterval = options.minTokenRefreshInterval || 10000; | ||
options.twilsockClient = options.twilsockClient || new Twilsock(token, options); | ||
options.transport = options.transport || new Transport(options.twilsockClient); | ||
let twilsock = options.twilsockClient; | ||
let transport = options.transport; | ||
let twilsock = options.twilsockClient; | ||
@@ -58,2 +69,4 @@ let reliableTransportState = { | ||
connectionStatus: { get: () => this._reliableTransportState.overall ? 'connected' : 'disconnected' }, | ||
updateToken: { value: limit(this._updateToken.bind(this), 1, minTokenRefreshInterval), enumerable: true } | ||
@@ -60,0 +73,0 @@ }); |
{ | ||
"name": "twilio-notifications", | ||
"version": "0.2.0-alpha.1", | ||
"version": "0.2.0-alpha.2", | ||
"description": "Client library for Twilio Notifications service", | ||
@@ -26,5 +26,5 @@ "main": "lib/client.js", | ||
"async": "^2.0.0-rc.3", | ||
"babel-eslint": "^6.1.2", | ||
"babel-eslint": "^7.0.0", | ||
"chai": "^3.4.1", | ||
"chai-as-promised": "^5.2.0", | ||
"chai-as-promised": "^6.0.0", | ||
"chai-spies": "^0.7.1", | ||
@@ -34,2 +34,3 @@ "event-to-promise": "^0.7.0", | ||
"gulp-eslint": "^3.0.1", | ||
"gulp-exit": "0.0.2", | ||
"gulp-istanbul": "^1.1.1", | ||
@@ -39,3 +40,2 @@ "gulp-mocha": "^3.0.1", | ||
"jsdoc": "^3.4.0", | ||
"jsdoc-babel": "^0.2.1", | ||
"proxyquire": "^1.7.3", | ||
@@ -45,4 +45,5 @@ "run-sequence": "^1.1.5", | ||
"sinon-as-promised": "^4.0.0", | ||
"sinon-chai": "^2.8.0" | ||
"sinon-chai": "^2.8.0", | ||
"twilio": "^2.11.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
240430
1255
19