UNPKG

sdk-lord-of-the-rings

Version:

```bash npm i sdk-lord-of-the-rings ```

25 lines (19 loc) 831 B
'use strict'; import chai from 'chai'; import LordSDK from '../index.js'; const lord = new LordSDK(); describe('Book', function () { it('It should get all books', async function () { const books = await lord.book.get(); chai.expect(books).to.be.an('object'); chai.expect(books).to.have.keys('docs', 'total', 'limit', 'offset', 'page', 'pages'); chai.expect(books.docs).to.be.an('array'); }); it('It should get all chapters for this book', async function () { const bookId = '5cf5805fb53e011a64671582'; const chapters = await lord.book.chapters(bookId); chai.expect(chapters).to.be.an('object'); chai.expect(chapters).to.have.keys('docs', 'total', 'limit', 'offset', 'page', 'pages'); chai.expect(chapters.docs).to.be.an('array'); }); });