UNPKG

threema-gateway-notify

Version:

Send Notifications via Threema Gateway with Typescript

50 lines 1.75 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const index_1 = require("./../index"); const assert_1 = require("assert"); describe('constructor', () => { // private toIds: string[], private fromId: string, private apiSecret: string it('should fail for missing toIds', () => { function execute() { new index_1.ThreemaConnector(); } expect(execute).toThrow(assert_1.AssertionError); }); it('should fail for empty toIds', () => { function execute() { new index_1.ThreemaConnector([], "from", "secret"); } expect(execute).toThrow(assert_1.AssertionError); }); it('should fail for missing fromId', () => { function execute() { new index_1.ThreemaConnector(["to1"]); } expect(execute).toThrow(assert_1.AssertionError); }); it('should fail for empty fromId', () => { function execute() { new index_1.ThreemaConnector(["to1"], ""); } expect(execute).toThrow(assert_1.AssertionError); }); it('should fail for missing secret', () => { function execute() { new index_1.ThreemaConnector(["to1"], "from"); } expect(execute).toThrow(assert_1.AssertionError); }); it('should fail for empty secret', () => { function execute() { new index_1.ThreemaConnector(["to1"], "from", ""); } expect(execute).toThrow(assert_1.AssertionError); }); it('should succeed', () => { function execute() { new index_1.ThreemaConnector(["to1"], "from", "secret"); } expect(execute).not.toThrow(); }); }); //# sourceMappingURL=index.test.js.map