From 9bcc3f214e45472e6d07262ed0c0b1b393d975d6 Mon Sep 17 00:00:00 2001 From: Jonatas Freitas Date: Wed, 26 Jul 2017 18:08:27 -0300 Subject: [PATCH 1/6] Added .travis.yml --- .travis.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..587bd3e --- /dev/null +++ b/.travis.yml @@ -0,0 +1 @@ +language: node_js From a01ce1df4a46e9b84e76a85f07620a09510d7121 Mon Sep 17 00:00:00 2001 From: Jonatas Freitas Date: Wed, 26 Jul 2017 18:11:22 -0300 Subject: [PATCH 2/6] Added nodejs version in .travis.yml --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 587bd3e..1607b55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1 +1,3 @@ language: node_js +node_js: + - "7" From 6dedffb16a5f38a8196b9591adbecc51d25dd61d Mon Sep 17 00:00:00 2001 From: Jonatas Freitas Date: Wed, 26 Jul 2017 18:12:27 -0300 Subject: [PATCH 3/6] Added nodejs version in .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1607b55..0fe294a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,3 @@ language: node_js node_js: - - "7" + - "7" From 8980f5a5b94e91162922061ebc2d4ecc1d4fed2c Mon Sep 17 00:00:00 2001 From: Jonatas Freitas Date: Wed, 26 Jul 2017 18:21:48 -0300 Subject: [PATCH 4/6] Change variables test to env variables --- README.md | 2 +- test/api.test.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 75134da..1bd016e 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ zapi.setCredentials('account', 'token'); run `npm install`. ### Make tests -for success send SMS tests case in api, fill `phone_number`, `zenvia_account`, `zenvia_token` on `test/api.test.js`. +for success send SMS tests case in api, fill `zenvia_phonenumber`, `zenvia_account`, `zenvia_password` on env variables. run `npm test`. diff --git a/test/api.test.js b/test/api.test.js index ae2a1e8..97fc236 100644 --- a/test/api.test.js +++ b/test/api.test.js @@ -5,12 +5,12 @@ const zapi = require('../index').api; describe('API', ()=>{ - const phone_number = '5551999999999'; - const zenvia_account = 'acc.count'; - const zenvia_token = 'aNythInK'; + const phone_number = process.env.zenvia_phonenumber; + const zenvia_account = process.env.zenvia_account; + const zenvia_password = process.env.zenvia_password; beforeEach(()=>{ - zapi.setCredentials(zenvia_account, zenvia_token); + zapi.setCredentials(zenvia_account, zenvia_password); }); it('should set credentials', () => { From 33b24cbd13e85b24797b3a89f28f694fd0e2fdf2 Mon Sep 17 00:00:00 2001 From: Jonatas Freitas Date: Wed, 26 Jul 2017 18:24:12 -0300 Subject: [PATCH 5/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1bd016e..71e1b97 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ # Zenvia SMS Core for NodeJS -Under construction! +[![Build Status](https://travis-ci.org/zenvia/zenvia-sms-core.svg?branch=master)](https://travis-ci.org/zenvia/zenvia-sms-core) Full and official implementation of Zenvia SMS API, send, monitor status and receive SMS from clients with this module. From e37a3f8d87d8f41c7f779e4bdfff8fbdec86609a Mon Sep 17 00:00:00 2001 From: Jonatas Freitas Date: Wed, 26 Jul 2017 18:26:27 -0300 Subject: [PATCH 6/6] Change timeout in tests --- test/api.test.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/api.test.js b/test/api.test.js index 97fc236..b64c7d6 100644 --- a/test/api.test.js +++ b/test/api.test.js @@ -135,7 +135,7 @@ describe('API', ()=>{ }) - }).timeout(5000); + }).timeout(10000); // TODO: refactor this it('should getSMSStatus function return catch 401', (done) => { @@ -155,7 +155,7 @@ describe('API', ()=>{ }); - }).timeout(5000); + }).timeout(10000); it('should getSMSReceivedList function return catch 401', (done) => { @@ -174,7 +174,7 @@ describe('API', ()=>{ }); - }).timeout(5000); + }).timeout(10000); it('should getSMSReceivedListSearch function return catch 401', (done) => { @@ -193,7 +193,7 @@ describe('API', ()=>{ }); - }).timeout(5000); + }).timeout(10000); it('should cancelScheduledSMS function return catch 401', (done) => { @@ -212,7 +212,7 @@ describe('API', ()=>{ }); - }).timeout(5000); + }).timeout(10000); it('should sendSMS function return success', (done) => { @@ -251,7 +251,7 @@ describe('API', ()=>{ }); - }).timeout(5000); + }).timeout(10000); it('should cancelScheduledSMS function return success', (done) => { @@ -297,7 +297,7 @@ describe('API', ()=>{ }); - }).timeout(5000); + }).timeout(10000); // TODO: make success tests for getSMSReceivedList and getSMSReceivedListSearch