@2bad/bitrix
Version:
Bitrix24 REST API client that doesn't suck
17 lines (16 loc) • 618 B
JavaScript
import Bitrix from './bitrix';
import * as client from './client';
describe('Bitrix', () => {
it('should init', () => {
expect(() => Bitrix('https://test.com', 'test_token')).not.toThrow();
});
it('should pass endpoint and access token to the client', () => {
const SpiedClient = jest.spyOn(client, 'default');
Bitrix('https://test.com', 'test_token');
expect(SpiedClient.mock.calls).toMatchSnapshot();
});
it('should expose API methods', () => {
const bitrix = Bitrix('https://test.com', 'test_token');
expect(bitrix).toMatchSnapshot();
});
});