2018-05-03 16:03:22 +00:00
|
|
|
/* gpgme.js - Javascript integration for gpgme
|
|
|
|
* Copyright (C) 2018 Bundesamt für Sicherheit in der Informationstechnik
|
|
|
|
*
|
|
|
|
* This file is part of GPGME.
|
|
|
|
*
|
|
|
|
* GPGME is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU Lesser General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2.1 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* GPGME is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* SPDX-License-Identifier: LGPL-2.1+
|
|
|
|
*/
|
2018-06-06 09:57:41 +00:00
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
import './node_modules/mocha/mocha'; /* global mocha, it, describe*/
|
|
|
|
import './node_modules/chai/chai';/* global chai*/
|
2018-06-06 09:57:41 +00:00
|
|
|
import { helper_params as hp } from './unittest_inputvalues';
|
|
|
|
import { message_params as mp } from './unittest_inputvalues';
|
|
|
|
import { whatever_params as wp } from './unittest_inputvalues';
|
|
|
|
import { key_params as kp } from './unittest_inputvalues';
|
|
|
|
import { Connection } from './src/Connection';
|
2018-08-22 10:18:55 +00:00
|
|
|
import { gpgme_error, err_list } from './src/Errors';
|
2018-06-06 09:57:41 +00:00
|
|
|
import { toKeyIdArray , isFingerprint } from './src/Helpers';
|
2018-08-20 10:12:43 +00:00
|
|
|
import { createKey } from './src/Key';
|
2018-06-06 09:57:41 +00:00
|
|
|
import { GPGME_Keyring } from './src/Keyring';
|
2018-08-20 13:12:01 +00:00
|
|
|
import { GPGME_Message, createMessage } from './src/Message';
|
2018-05-03 16:03:22 +00:00
|
|
|
|
|
|
|
mocha.setup('bdd');
|
2018-06-06 11:05:53 +00:00
|
|
|
const expect = chai.expect;
|
2018-05-03 16:03:22 +00:00
|
|
|
chai.config.includeStack = true;
|
|
|
|
|
|
|
|
function unittests (){
|
2018-08-20 13:12:01 +00:00
|
|
|
describe('Connection testing', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Connecting', function (done) {
|
2018-05-03 16:03:22 +00:00
|
|
|
let conn0 = new Connection;
|
2018-08-20 13:12:01 +00:00
|
|
|
conn0.checkConnection().then(function (answer) {
|
2018-05-25 09:53:24 +00:00
|
|
|
expect(answer).to.not.be.empty;
|
|
|
|
expect(answer.gpgme).to.not.be.undefined;
|
|
|
|
expect(answer.gpgme).to.be.a('string');
|
|
|
|
expect(answer.info).to.be.an('Array');
|
2018-05-03 16:03:22 +00:00
|
|
|
expect(conn0.disconnect).to.be.a('function');
|
|
|
|
expect(conn0.post).to.be.a('function');
|
|
|
|
done();
|
2018-05-25 09:53:24 +00:00
|
|
|
});
|
2018-05-03 16:03:22 +00:00
|
|
|
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Disconnecting', function (done) {
|
2018-05-03 16:03:22 +00:00
|
|
|
let conn0 = new Connection;
|
2018-08-20 13:12:01 +00:00
|
|
|
conn0.checkConnection(false).then(function (answer) {
|
2018-05-25 09:53:24 +00:00
|
|
|
expect(answer).to.be.true;
|
|
|
|
conn0.disconnect();
|
2018-08-20 13:12:01 +00:00
|
|
|
conn0.checkConnection(false).then(function (result) {
|
2018-05-25 09:53:24 +00:00
|
|
|
expect(result).to.be.false;
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
2018-05-03 16:03:22 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
describe('Error Object handling', function (){
|
2018-05-25 17:02:18 +00:00
|
|
|
// TODO: new GPGME_Error codes
|
2018-08-20 13:12:01 +00:00
|
|
|
it('check the Timeout error', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = gpgme_error('CONN_TIMEOUT');
|
|
|
|
|
|
|
|
expect(test0).to.be.an.instanceof(Error);
|
|
|
|
expect(test0.code).to.equal('CONN_TIMEOUT');
|
|
|
|
});
|
|
|
|
|
2018-06-06 09:57:41 +00:00
|
|
|
it('Error Object returns generic code if code is not listed',
|
2018-08-20 13:12:01 +00:00
|
|
|
function (){
|
2018-06-06 09:57:41 +00:00
|
|
|
let test0 = gpgme_error(hp.invalidErrorCode);
|
2018-05-03 16:03:22 +00:00
|
|
|
|
2018-06-06 09:57:41 +00:00
|
|
|
expect(test0).to.be.an.instanceof(Error);
|
|
|
|
expect(test0.code).to.equal('GENERIC_ERROR');
|
|
|
|
}
|
|
|
|
);
|
2018-05-03 16:03:22 +00:00
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Warnings like PARAM_IGNORED should not return errors', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = gpgme_error('PARAM_IGNORED');
|
|
|
|
|
|
|
|
expect(test0).to.be.null;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
describe('Fingerprint checking', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('isFingerprint(): valid Fingerprint', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = isFingerprint(hp.validFingerprint);
|
|
|
|
|
|
|
|
expect(test0).to.be.true;
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('isFingerprint(): invalid Fingerprints', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
for (let i=0; i < hp.invalidFingerprints.length; i++){
|
|
|
|
let test0 = isFingerprint(hp.invalidFingerprints[i]);
|
|
|
|
|
|
|
|
expect(test0).to.be.false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
describe('toKeyIdArray() (converting input to fingerprint)', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Correct fingerprint string', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = toKeyIdArray(hp.validFingerprint);
|
|
|
|
|
|
|
|
expect(test0).to.be.an('array');
|
|
|
|
expect(test0).to.include(hp.validFingerprint);
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('openpgpjs-like object', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = toKeyIdArray(hp.valid_openpgplike);
|
|
|
|
|
|
|
|
expect(test0).to.be.an('array').with.lengthOf(1);
|
|
|
|
expect(test0).to.include(
|
|
|
|
hp.valid_openpgplike.primaryKey.getFingerprint());
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Array of valid inputs', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = toKeyIdArray(hp.validKeys);
|
|
|
|
expect(test0).to.be.an('array');
|
|
|
|
expect(test0).to.have.lengthOf(hp.validKeys.length);
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Incorrect inputs', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('valid Long ID', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = toKeyIdArray(hp.validLongId);
|
|
|
|
|
|
|
|
expect(test0).to.be.empty;
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('invalidFingerprint', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = toKeyIdArray(hp.invalidFingerprint);
|
|
|
|
|
|
|
|
expect(test0).to.be.empty;
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('invalidKeyArray', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = toKeyIdArray(hp.invalidKeyArray);
|
|
|
|
|
|
|
|
expect(test0).to.be.empty;
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Partially invalid array', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = toKeyIdArray(hp.invalidKeyArray_OneBad);
|
|
|
|
|
|
|
|
expect(test0).to.be.an('array');
|
|
|
|
expect(test0).to.have.lengthOf(
|
|
|
|
hp.invalidKeyArray_OneBad.length - 1);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
describe('GPGME_Key', function (){
|
|
|
|
it('Key has data after a first refresh', function (done) {
|
2018-05-28 14:52:50 +00:00
|
|
|
let key = createKey(kp.validKeyFingerprint);
|
2018-08-20 13:12:01 +00:00
|
|
|
key.refreshKey().then(function (key2){
|
2018-05-25 17:02:18 +00:00
|
|
|
expect(key2.get).to.be.a('function');
|
|
|
|
for (let i=0; i < kp.validKeyProperties.length; i++) {
|
|
|
|
let prop = key2.get(kp.validKeyProperties[i]);
|
|
|
|
expect(prop).to.not.be.undefined;
|
|
|
|
expect(prop).to.be.a('boolean');
|
|
|
|
}
|
|
|
|
expect(isFingerprint(key2.get('fingerprint'))).to.be.true;
|
|
|
|
expect(
|
|
|
|
key2.get('fingerprint')).to.equal(kp.validKeyFingerprint);
|
|
|
|
expect(
|
|
|
|
key2.get('fingerprint')).to.equal(key.fingerprint);
|
|
|
|
done();
|
|
|
|
});
|
2018-05-03 16:03:22 +00:00
|
|
|
});
|
|
|
|
|
2018-05-25 17:02:18 +00:00
|
|
|
it('Non-cached key async data retrieval', function (done){
|
2018-07-27 18:36:21 +00:00
|
|
|
let key = createKey(kp.validKeyFingerprint, true);
|
2018-08-20 13:12:01 +00:00
|
|
|
key.get('can_authenticate').then(function (result){
|
2018-05-25 17:02:18 +00:00
|
|
|
expect(result).to.be.a('boolean');
|
|
|
|
done();
|
|
|
|
});
|
2018-05-28 15:26:56 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('Non-cached key async armored Key', function (done){
|
2018-07-27 18:36:21 +00:00
|
|
|
let key = createKey(kp.validKeyFingerprint, true);
|
2018-08-20 13:12:01 +00:00
|
|
|
key.get('armored').then(function (result){
|
2018-05-28 15:26:56 +00:00
|
|
|
expect(result).to.be.a('string');
|
|
|
|
expect(result).to.include('KEY BLOCK-----');
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Non-cached key async hasSecret', function (done){
|
2018-07-27 18:36:21 +00:00
|
|
|
let key = createKey(kp.validKeyFingerprint, true);
|
2018-08-20 13:12:01 +00:00
|
|
|
key.get('hasSecret').then(function (result){
|
2018-05-28 15:26:56 +00:00
|
|
|
expect(result).to.be.a('boolean');
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Non-cached key async hasSecret (no secret in Key)', function (done){
|
2018-07-27 18:36:21 +00:00
|
|
|
let key = createKey(kp.validFingerprintNoSecret, true);
|
2018-08-20 13:12:01 +00:00
|
|
|
key.get('hasSecret').then(function (result){
|
2018-05-28 15:26:56 +00:00
|
|
|
expect(result).to.be.a('boolean');
|
|
|
|
expect(result).to.equal(false);
|
|
|
|
done();
|
|
|
|
});
|
|
|
|
});
|
2018-05-25 17:02:18 +00:00
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Querying non-existing Key returns an error', function (done) {
|
2018-05-28 14:52:50 +00:00
|
|
|
let key = createKey(kp.invalidKeyFingerprint);
|
2018-08-20 13:12:01 +00:00
|
|
|
key.refreshKey().then(function (){},
|
|
|
|
function (error){
|
2018-05-25 17:02:18 +00:00
|
|
|
expect(error).to.be.an.instanceof(Error);
|
|
|
|
expect(error.code).to.equal('KEY_NOKEY');
|
2018-05-25 09:53:24 +00:00
|
|
|
done();
|
2018-06-06 09:57:41 +00:00
|
|
|
});
|
2018-05-03 16:03:22 +00:00
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('createKey returns error if parameters are wrong', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
for (let i=0; i< 4; i++){
|
2018-08-22 10:18:55 +00:00
|
|
|
expect(function (){
|
|
|
|
createKey(wp.four_invalid_params[i]);
|
|
|
|
}).to.throw(
|
|
|
|
err_list.PARAM_WRONG.msg
|
|
|
|
);
|
|
|
|
|
2018-05-03 16:03:22 +00:00
|
|
|
}
|
|
|
|
});
|
2018-05-25 17:02:18 +00:00
|
|
|
|
2018-08-20 10:12:43 +00:00
|
|
|
// it('Overwriting getFingerprint does not work', function(){
|
|
|
|
// const evilFunction = function(){
|
|
|
|
// return 'bad Data';
|
|
|
|
// };
|
|
|
|
// let key = createKey(kp.validKeyFingerprint, true);
|
|
|
|
// expect(key.fingerprint).to.equal(kp.validKeyFingerprint);
|
|
|
|
// try {
|
|
|
|
// key.getFingerprint = evilFunction;
|
|
|
|
// }
|
|
|
|
// catch(e) {
|
|
|
|
// expect(e).to.be.an.instanceof(TypeError);
|
|
|
|
// }
|
|
|
|
// expect(key.fingerprint).to.equal(kp.validKeyFingerprint);
|
|
|
|
// expect(key.getFingerprint).to.not.equal(evilFunction);
|
|
|
|
// });
|
2018-05-03 16:03:22 +00:00
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
describe('GPGME_Keyring', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('correct Keyring initialization', function (){
|
2018-05-28 14:52:50 +00:00
|
|
|
let keyring = new GPGME_Keyring;
|
2018-05-03 16:03:22 +00:00
|
|
|
expect(keyring).to.be.an.instanceof(GPGME_Keyring);
|
|
|
|
expect(keyring.getKeys).to.be.a('function');
|
|
|
|
});
|
|
|
|
|
2018-06-06 11:05:53 +00:00
|
|
|
it('Loading Keys from Keyring, to be used synchronously',
|
2018-08-20 13:12:01 +00:00
|
|
|
function (done){
|
2018-06-06 11:05:53 +00:00
|
|
|
let keyring = new GPGME_Keyring;
|
2018-08-23 10:15:59 +00:00
|
|
|
keyring.getKeys({ prepare_sync: true }).then(function (result){
|
2018-06-06 11:05:53 +00:00
|
|
|
expect(result).to.be.an('array');
|
2018-07-09 09:24:46 +00:00
|
|
|
expect(result[0].get('hasSecret')).to.be.a('boolean');
|
2018-06-06 11:05:53 +00:00
|
|
|
done();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
);
|
2018-06-06 09:57:41 +00:00
|
|
|
|
2018-06-06 11:05:53 +00:00
|
|
|
it('Loading specific Key from Keyring, to be used synchronously',
|
2018-08-20 13:12:01 +00:00
|
|
|
function (done){
|
2018-06-06 11:05:53 +00:00
|
|
|
let keyring = new GPGME_Keyring;
|
2018-08-23 10:15:59 +00:00
|
|
|
keyring.getKeys({
|
|
|
|
pattern: kp.validKeyFingerprint,
|
|
|
|
prepare_sync: true }).then(
|
2018-08-20 13:12:01 +00:00
|
|
|
function (result){
|
2018-06-06 11:05:53 +00:00
|
|
|
expect(result).to.be.an('array');
|
2018-07-09 09:24:46 +00:00
|
|
|
expect(result[0].get('hasSecret')).to.be.a('boolean');
|
2018-06-06 11:05:53 +00:00
|
|
|
done();
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
);
|
2018-06-06 09:57:41 +00:00
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Querying non-existing Key from Keyring', function (done){
|
2018-06-06 09:57:41 +00:00
|
|
|
let keyring = new GPGME_Keyring;
|
2018-06-06 11:05:53 +00:00
|
|
|
keyring.getKeys(kp.invalidKeyFingerprint, true).then(
|
2018-08-20 13:12:01 +00:00
|
|
|
function (result){
|
2018-06-06 11:05:53 +00:00
|
|
|
expect(result).to.be.an('array');
|
|
|
|
expect(result.length).to.equal(0);
|
|
|
|
done();
|
|
|
|
}
|
|
|
|
);
|
2018-06-06 09:57:41 +00:00
|
|
|
});
|
2018-05-03 16:03:22 +00:00
|
|
|
|
2018-06-06 11:05:53 +00:00
|
|
|
});
|
2018-06-06 09:57:41 +00:00
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
describe('GPGME_Message', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('creating encrypt Message', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = createMessage('encrypt');
|
|
|
|
|
|
|
|
expect(test0).to.be.an.instanceof(GPGME_Message);
|
2018-07-27 18:36:21 +00:00
|
|
|
expect(test0.isComplete()).to.be.false;
|
2018-05-03 16:03:22 +00:00
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Message is complete after setting mandatory data', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = createMessage('encrypt');
|
|
|
|
test0.setParameter('data', mp.valid_encrypt_data);
|
|
|
|
test0.setParameter('keys', hp.validFingerprints);
|
|
|
|
|
2018-07-27 18:36:21 +00:00
|
|
|
expect(test0.isComplete()).to.be.true;
|
2018-05-03 16:03:22 +00:00
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Message is not complete after mandatory data is empty', function (){
|
2018-05-07 16:27:25 +00:00
|
|
|
let test0 = createMessage('encrypt');
|
|
|
|
test0.setParameter('keys', hp.validFingerprints);
|
2018-07-27 18:36:21 +00:00
|
|
|
expect(test0.isComplete()).to.be.false;
|
2018-08-22 10:18:55 +00:00
|
|
|
expect(function (){
|
|
|
|
test0.setParameter('data', '');
|
|
|
|
}).to.throw(
|
|
|
|
err_list.PARAM_WRONG.msg);
|
2018-05-07 16:27:25 +00:00
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Complete Message contains the data that was set', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = createMessage('encrypt');
|
|
|
|
test0.setParameter('data', mp.valid_encrypt_data);
|
|
|
|
test0.setParameter('keys', hp.validFingerprints);
|
|
|
|
|
|
|
|
expect(test0.message).to.not.be.null;
|
2018-06-08 15:54:58 +00:00
|
|
|
expect(test0.message).to.have.keys('op', 'data', 'keys',
|
|
|
|
'chunksize');
|
2018-05-03 16:03:22 +00:00
|
|
|
expect(test0.message.op).to.equal('encrypt');
|
|
|
|
expect(test0.message.data).to.equal(
|
|
|
|
mp.valid_encrypt_data);
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it ('Not accepting non-allowed operation', function (){
|
2018-08-22 10:18:55 +00:00
|
|
|
expect(function () {
|
|
|
|
createMessage(mp.invalid_op_action);
|
|
|
|
}).to.throw(
|
|
|
|
err_list.MSG_WRONG_OP.msg);
|
2018-05-03 16:03:22 +00:00
|
|
|
});
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Not accepting wrong parameter type', function (){
|
2018-08-22 10:18:55 +00:00
|
|
|
expect(function () {
|
|
|
|
createMessage(mp.invalid_op_type);
|
|
|
|
}).to.throw(
|
|
|
|
err_list.PARAM_WRONG.msg);
|
2018-05-03 16:03:22 +00:00
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Not accepting wrong parameter name', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = createMessage(mp.invalid_param_test.valid_op);
|
|
|
|
for (let i=0;
|
|
|
|
i < mp.invalid_param_test.invalid_param_names.length; i++){
|
2018-08-22 10:18:55 +00:00
|
|
|
expect(function (){
|
|
|
|
test0.setParameter(
|
|
|
|
mp.invalid_param_test.invalid_param_names[i],
|
|
|
|
'Somevalue');}
|
|
|
|
).to.throw(err_list.PARAM_WRONG.msg);
|
2018-05-03 16:03:22 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
it('Not accepting wrong parameter value', function (){
|
2018-05-03 16:03:22 +00:00
|
|
|
let test0 = createMessage(mp.invalid_param_test.valid_op);
|
|
|
|
for (let j=0;
|
|
|
|
j < mp.invalid_param_test.invalid_values_0.length; j++){
|
2018-08-22 10:18:55 +00:00
|
|
|
expect(function (){
|
|
|
|
test0.setParameter(
|
|
|
|
mp.invalid_param_test.validparam_name_0,
|
|
|
|
mp.invalid_param_test.invalid_values_0[j]);
|
|
|
|
}).to.throw(err_list.PARAM_WRONG.msg);
|
2018-05-03 16:03:22 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-08-20 13:12:01 +00:00
|
|
|
export default { unittests };
|