Skip to content

Commit

Permalink
fix: Unauthorized test
Browse files Browse the repository at this point in the history
  • Loading branch information
vafanassieff committed Nov 10, 2021
1 parent 4b9ed0a commit a02cee2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
)
}
})
})

0 comments on commit a02cee2

Please sign in to comment.