feat: allow env variables to overwrite smtp config

Fixes #3
This commit is contained in:
Anselm Stordeur
2019-01-09 17:53:53 +01:00
parent cdbbb0ae1f
commit 3d82c94577
4 changed files with 199 additions and 84 deletions

70
test/Common.spec.ts Normal file
View File

@@ -0,0 +1,70 @@
/*
* Copyright (C) 2019 StApps
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, version 3.
*
* This program 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 General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <https://www.gnu.org/licenses/>.
*/
import { expect } from 'chai';
import { slow, suite, test, timeout } from 'mocha-typescript';
import { deleteUndefinedProperties } from '../src/common';
@suite(timeout(2000), slow(1000))
export class CommonSpec {
/* tslint:disable:member-ordering */
@test
deleteUndefinedProperties1() {
expect(deleteUndefinedProperties(
{
a: 2,
b: {
c: 3,
d: undefined,
},
},
)).to.deep.equal(
{
a: 2,
b: {
c: 3,
},
},
);
}
@test
deleteUndefinedProperties2() {
expect(deleteUndefinedProperties(
{
a: undefined,
b: undefined,
},
)).to.deep.equal(
{},
);
}
@test
deleteUndefinedProperties3() {
expect(deleteUndefinedProperties(
{
a: 2,
b: 'foo',
c: 'bar',
},
)).to.deep.equal(
{
a: 2,
b: 'foo',
c: 'bar',
},
);
}
}