Merge branch 'release' into merge-release-into-dev
This commit is contained in:
commit
b885e5698c
11 changed files with 132 additions and 25 deletions
|
|
@ -1,7 +1,10 @@
|
|||
import test from 'ava'
|
||||
import _ from 'lodash/fp'
|
||||
import path from 'path'
|
||||
|
||||
import {mapKeyValuesDeep} from '../../lib/migrate-options'
|
||||
import {mapKeyValuesDeep, updateOptionBasepath} from '../../lib/migrate-options'
|
||||
|
||||
const currentBasePath = path.dirname(path.dirname(__dirname))
|
||||
|
||||
test('mapKeyValuesDeep', t => {
|
||||
const test = {
|
||||
|
|
@ -33,3 +36,29 @@ test('mapKeyValuesDeep', t => {
|
|||
|
||||
t.deepEqual(result, expected)
|
||||
})
|
||||
|
||||
test('updateOptionBasepath', t => {
|
||||
const test = {
|
||||
someBooleanOption: true,
|
||||
someStringOption: 'my-custom-option',
|
||||
customExternalPath: '/usr/lib/node_modules/ava',
|
||||
seedPath: '/etc/lamassu/seeds/seed.txt',
|
||||
caPath: '/usr/lib/node_modules/lamassu-server/certs/Lamassu_OP_Root_CA.pem'
|
||||
}
|
||||
const expected = {
|
||||
someBooleanOption: true,
|
||||
someStringOption: 'my-custom-option',
|
||||
customExternalPath: '/usr/lib/node_modules/ava',
|
||||
seedPath: '/etc/lamassu/seeds/seed.txt',
|
||||
caPath: path.join(currentBasePath, 'certs/Lamassu_OP_Root_CA.pem')
|
||||
}
|
||||
|
||||
let result = _.clone(test)
|
||||
|
||||
_.each(
|
||||
_.wrap(updateOptionBasepath, result),
|
||||
_.keys(test)
|
||||
)
|
||||
|
||||
t.deepEqual(result, expected)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue