diff --git a/.travis.yml b/.travis.yml index 85ae51cd..fd3fbde1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,8 @@ node_js: - 8 - 9 - 10 -before_script: -- npm install -g grunt-cli +env: + - CMD="npm test" notifications: slack: secure: CEhTJBzvdIEOWdjylkoDl+ioI5dHIBCgoHsRHAQFY0H7hhcuPHlJSr5MKNo65TRZfvDYUcVvbw62jBMmAIr878NQBnEPnhF/DusMB0JiZoIT2fKB2jMMzlql1NyzlEpIT1fnONBWewOeRSzp4fIu6xct4pvBja044o6PUw+TVRg= diff --git a/DEVELOPING.md b/DEVELOPING.md index c0b95543..372a01a3 100644 --- a/DEVELOPING.md +++ b/DEVELOPING.md @@ -4,26 +4,21 @@ This document describes tools, tasks and workflow that one needs to be familiar this project. If you use this package within your own software as is but don't plan on modifying it, this guide is **not** for you. -## Tools - -* [Grunt](http://gruntjs.com/): used to run predefined tasks. Install all development dependencies (`npm install`) - and also install the grunt CLI (`npm install -g grunt-cli`). - ## Tasks ### Testing This project's tests are written with Mocha and with Jasmine. Common tasks: -* `grunt` - run the complete test suite. -* `grunt mochaTest` - run just the mocha tests -* `grunt jasmine_node` - run just the jasmine tests +* `npm run test` - run the complete test suite. +* `npm run mochaTest` - run just the mocha tests +* `npm run jasmine_node` - run just the jasmine tests ### Releasing In order to create a release, the following should be completed in order. -1. Ensure all the tests are passing (`grunt`) and that there is enough test coverage. +1. Ensure all the tests are passing (`pm run test`) and that there is enough test coverage. 1. Ensure package-lock.json and yarn.lock have been updated and committed if any dependency has been added/removed. 1. Make sure you are on the `dev` branch of the repository, with all changes merged/committed already. diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 7e47959f..00000000 --- a/Gruntfile.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = function (grunt) { - // Project configuration. - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - mochaTest: { - test: { - options: { - reporter: 'spec' - }, - src: ['test/**/*test.js'] - } - }, - jasmine_node: { - options: { - extensions: 'js', - specNameMatcher: 'spec' - }, - all: ['spec/'] - } - }); - - grunt.loadNpmTasks('grunt-mocha-test'); - grunt.loadNpmTasks('grunt-jasmine-node'); - - grunt.registerTask('default', ['mochaTest', 'jasmine_node']); -}; diff --git a/lib/archiving.js b/lib/archiving.js index 433652e5..cd76d395 100644 --- a/lib/archiving.js +++ b/lib/archiving.js @@ -169,10 +169,7 @@ function Archive(config, properties) { api = function (config, method, path, body, callback) { var rurl = config.apiEndpoint + '/v2/project/' + config.apiKey + path; - if ('defaults' in request) { - request = request.defaults(_.pick(config, 'proxy', 'timeout')); - } - request({ + request.defaults(_.pick(config, 'proxy', 'timeout'))({ url: rurl, method: method, headers: generateHeaders(config), diff --git a/lib/callbacks.js b/lib/callbacks.js index b1ba6184..94ff2660 100644 --- a/lib/callbacks.js +++ b/lib/callbacks.js @@ -9,10 +9,7 @@ var generateJwt = require('./generateJwt'); var api = function (config, method, path, body, callback) { var rurl = config.apiEndpoint + '/v2/project/' + config.apiKey + path; - if ('defaults' in request) { - request = request.defaults(_.pick(config, 'proxy', 'timeout')); - } - request({ + request.defaults(_.pick(config, 'proxy', 'timeout'))({ url: rurl, method: method, headers: { diff --git a/lib/moderation.js b/lib/moderation.js index 7c934a78..42e0de69 100644 --- a/lib/moderation.js +++ b/lib/moderation.js @@ -12,10 +12,7 @@ var api = function (config, method, session, connection, body, callback) { if (connection) { rurl += '/connection/' + connection; } - if ('defaults' in request) { - request = request.defaults(_.pick(config, 'proxy', 'timeout')); - } - request({ + request.defaults(_.pick(config, 'proxy', 'timeout'))({ url: rurl, method: method, headers: { diff --git a/lib/opentok.js b/lib/opentok.js index 41a09918..2d08b627 100644 --- a/lib/opentok.js +++ b/lib/opentok.js @@ -900,8 +900,7 @@ OpenTok = function (apiKey, apiSecret, env) { *