From a5d2384b6554fc57176ff753a297022c9a207d03 Mon Sep 17 00:00:00 2001 From: Arjun Raj Date: Tue, 1 Dec 2020 06:58:12 +0000 Subject: [PATCH] fix: update node APIs --- index.js | 2 +- test/test.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index c359075..2e89958 100644 --- a/index.js +++ b/index.js @@ -60,7 +60,7 @@ module.exports = exports = (app) => (args) => { let contentType = res.headers['content-type'] || 'text/plain'; contentType = contentType.split(';')[0]; if (isBinary(contentType)) - body = new Buffer(body).toString('base64'); + body = new Buffer.from(body).toString('base64'); // Convert response back to a OpenWhisk response object. return resolve({ diff --git a/test/test.js b/test/test.js index 2f236dd..5934477 100644 --- a/test/test.js +++ b/test/test.js @@ -47,7 +47,7 @@ describe('get', () => { __ow_method: 'get', __ow_path: '/' }).then(res => { - assert.equal('hello', res.body); + assert.strictEqual('hello', res.body); done(); }); }); @@ -63,7 +63,7 @@ describe('post', () => { __ow_path: '/', __ow_body:'{}' }).then(res => { - assert.equal('e30=', res.body); + assert.strictEqual('e30=', res.body); done(); }); }); @@ -78,7 +78,7 @@ describe('patch', () => { __ow_path: '/', __ow_body:'{}' }).then(res => { - assert.equal('e30=', res.body); + assert.strictEqual('e30=', res.body); done(); }); }); @@ -93,7 +93,7 @@ describe('put', () => { __ow_path: '/', __ow_body:'{}' }).then(res => { - assert.equal('e30=', res.body); + assert.strictEqual('e30=', res.body); done(); }); });