1
0
mirror of synced 2025-02-16 15:53:14 +03:00
mg-bot-api-client-js/tests/test_index.js

26 lines
748 B
JavaScript
Raw Normal View History

2019-03-01 13:46:30 +03:00
import chai from 'chai'
import RetailcrmBotApiClient from '../dist/index'
2019-02-08 13:31:38 +03:00
describe('#Constructor', function () {
it('Empty url', function () {
chai.expect(function() {
new RetailcrmBotApiClient({token: 'test_token'});
}).to.throw('Url is required');
});
it('Incorrect url', function () {
chai.expect(function() {
new RetailcrmBotApiClient({
host: 'http://api.example.com',
token: 'test_token'
});
}).to.throw('HTTPS required');
});
it('Empty token', function () {
chai.expect(function() {
new RetailcrmBotApiClient({host: 'https://api.example.com'});
}).to.throw('Token is required');
});
});