describe('object operations', () => {
let data
before(async () => {
const params = 'rest ap link' // See instructions in "Setting up"
const result = await rp(params)
// const cloneResult = JSON.parse(JSON.stringify(result)) - cloneResult.bpi тоже undefined
data = result.bpi // undefined
console.log(data)
})
...
}
// result
{"bpi":{"2019-01-25":3582.2,"2019-01-26":3580.775,"2019-01-27":3553.0133,"2019-01-28":3454.48,"2019-01-29":3421.12,"2019-01-30":3482.3,"2019-01-31":3441.985},"disclaimer":"This data was produced from the CoinDesk Bitcoin Price Index. BPI value data returned as USD.","time":{"updated":"Feb 1, 2019 00:03:00 UTC","updatedISO":"2019-02-01T00:03:00+00:00"}}
почему result.bpi undefined и как исправить?