Lamassu update script changes (#126)

* lamassu-migrate-config script added + lamassu-default.json

* lamassu update script changes

* lamassu-update unit test added
This commit is contained in:
Fabio Cigliano 2018-06-16 22:55:42 +12:00 committed by Josh Harvey
parent 63e0782e32
commit c3535e6ed3
8 changed files with 213 additions and 36 deletions

View file

@ -0,0 +1,35 @@
import test from 'ava'
import _ from 'lodash/fp'
import {mapKeyValuesDeep} from '../../lib/migrate-options'
test('mapKeyValuesDeep', t => {
const test = {
a: {
b: 1
},
c: [
{
d: 2,
e: 3
}
],
f: {
g: {
h: [
{
i: 4
}
]
}
}
}
const expected = [{b: 1}, {d: 2}, {e: 3}, {i: 4}]
const result = []
mapKeyValuesDeep((v, k) => {
result.push(_.fromPairs([[k, v]]))
}, test)
t.deepEqual(result, expected)
})