mirror of
https://github.com/donl/plivo-node.git
synced 2026-05-31 22:07:36 -06:00
Merge pull request #107 from patelravi/message_list_test
Message list test
This commit is contained in:
commit
b8d2b11530
3 changed files with 16 additions and 3 deletions
|
|
@ -43,6 +43,8 @@ gulp.task('pre-test', function () {
|
|||
gulp.task('test', ['pre-test'], function (cb) {
|
||||
var mochaErr;
|
||||
|
||||
console.log('Running tests with node version', process.version);
|
||||
|
||||
gulp.src('test/**/*.js')
|
||||
.pipe(plumber())
|
||||
.pipe(mocha({ reporter: 'spec' }))
|
||||
|
|
@ -62,6 +64,7 @@ gulp.task('watch', function () {
|
|||
|
||||
gulp.task('coveralls', ['test'], function () {
|
||||
if (!process.env.CI) {
|
||||
console.log('ignoring coveralls report generation.');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,17 @@ export function camelCaseRequestWrapper(requestFunc) {
|
|||
return (method, action, params) => {
|
||||
|
||||
params = recursivelyRenameObject(params, function (value, key) {
|
||||
if(typeof key !== 'string') return key;
|
||||
if (typeof key !== 'string') return key;
|
||||
|
||||
// Snake Case logic has issue, it replaces double underscores with single
|
||||
// So dont run snake case logic for following params
|
||||
let skipParamsFromSnakeCasing = [
|
||||
'message_time__lt', 'message_time__lte',
|
||||
'message_time__gt', 'message_time__gte',
|
||||
]
|
||||
if (skipParamsFromSnakeCasing.indexOf(key) >= 0) {
|
||||
return key;
|
||||
}
|
||||
|
||||
return _snakeCase(key)
|
||||
.replace('_less_than', '__lt')
|
||||
|
|
@ -35,7 +45,7 @@ export function camelCaseRequestWrapper(requestFunc) {
|
|||
|
||||
return requestFunc(method, action, params).then(res => {
|
||||
res.body = recursivelyRenameObject(res.body, function (value, key) {
|
||||
if(typeof key !== 'string') return key;
|
||||
if (typeof key !== 'string') return key;
|
||||
return _camelCase(key);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -66,4 +66,4 @@
|
|||
"uri-parser": "^1.0.0",
|
||||
"utf8": "^2.1.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue