mirror of
https://github.com/node-ebics/node-ebics-client.git
synced 2024-12-24 21:31:48 +00:00
tests: start Client tests
This commit is contained in:
parent
d482b1dde1
commit
6ecb256483
29
test/unit/ClientTest.js
Normal file
29
test/unit/ClientTest.js
Normal file
@ -0,0 +1,29 @@
|
||||
'use strict';
|
||||
|
||||
/* eslint-env node, mocha */
|
||||
|
||||
const { assert } = require('chai');
|
||||
|
||||
const { Client, fsKeysStorage, tracesStorage } = require('../../index.js');
|
||||
|
||||
describe('Client', () => {
|
||||
describe('instantiating', () => {
|
||||
it('should throw with no options provided', () => assert.throws(() => new Client()));
|
||||
it('should throw with no url provided', () => assert.throws(() => new Client({})));
|
||||
it('should throw with no partnerId provided', () => assert.throws(() => new Client({ url: 'https://myebics.com' })));
|
||||
it('should throw with no userId provided', () => assert.throws(() => new Client({ url: 'https://myebics.com', partnerId: 'partnerId' })));
|
||||
it('should throw with no hostId provided', () => assert.throws(() => new Client({ url: 'https://myebics.com', partnerId: 'partnerId', userId: 'userId' })));
|
||||
it('should throw with no passphrase provided', () => assert.throws(() => new Client({
|
||||
url: 'https://myebics.com', partnerId: 'partnerId', userId: 'userId', hostId: 'hostId',
|
||||
})));
|
||||
it('should throw with no keyStorage provided', () => assert.throws(() => new Client({
|
||||
url: 'https://myebics.com', partnerId: 'partnerId', userId: 'userId', hostId: 'hostId', passphrase: 'test',
|
||||
})));
|
||||
it('should create an isntance without tracesStorage', () => assert.doesNotThrow(() => new Client({
|
||||
url: 'https://myebics.com', partnerId: 'partnerId', userId: 'userId', hostId: 'hostId', passphrase: 'test', keyStorage: fsKeysStorage('./test.key'),
|
||||
})));
|
||||
it('should create an isntance with tracesStorage', () => assert.doesNotThrow(() => new Client({
|
||||
url: 'https://myebics.com', partnerId: 'partnerId', userId: 'userId', hostId: 'hostId', passphrase: 'test', keyStorage: fsKeysStorage('./test.key'), tracesStorage: tracesStorage('./'),
|
||||
})));
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user