From a02cee2ce310b4203ca2ff68566830005411726e Mon Sep 17 00:00:00 2001 From: Victor Afanassieff Date: Wed, 10 Nov 2021 15:18:59 +0100 Subject: [PATCH] fix: Unauthorized test --- test/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/test/index.js b/test/index.js index f2993cc..aecca1e 100644 --- a/test/index.js +++ b/test/index.js @@ -29,13 +29,15 @@ describe('Rest', () => { expect(info).to.be.an('object') }) - it('Unauthorized', (done) => { + it('No Api Key', () => { const lnm = new LNMarketsRest() - lnm.futuresCancelAllPositions().catch((error) => { + try { + lnm.futuresCancelAllPositions() + } catch (error) { expect(error).to.be.instanceOf(Error) - expect(error.statusCode).to.be.equal(401) - expect(error.code).to.be.equal('Unauthorized') - done() - }) + expect(error.message).to.be.equal( + 'You need an API key to use an authenficated route' + ) + } }) })