chore: monorepo setup (#7175)

This commit is contained in:
Noel
2022-01-07 17:18:25 +01:00
committed by GitHub
parent 780b7ed39f
commit 16390efe6e
504 changed files with 25459 additions and 22830 deletions

View File

@@ -0,0 +1,18 @@
import nock from 'nock';
import { DefaultRestOptions, REST } from '../src';
const api = new REST();
nock(`${DefaultRestOptions.api}/v${DefaultRestOptions.version}`).get('/simpleGet').reply(200, { test: true });
test('no token', async () => {
const promise = api.get('/simpleGet');
await expect(promise).rejects.toThrowError('Expected token to be set for this request, but none was present');
await expect(promise).rejects.toBeInstanceOf(Error);
});
test('negative offset', () => {
const badREST = new REST({ offset: -5000 });
expect(badREST.requestManager.options.offset).toBe(0);
});