Fix indents
This commit is contained in:
@@ -3,27 +3,27 @@ export default function({faker, url}) {
|
||||
//Last.fm api
|
||||
if (/^https:..testapp.herokuapp.com.*$/.test(url)) {
|
||||
//Get Nightscout Data
|
||||
console.debug(`metrics/compute/mocks > mocking nightscout api result > ${url}`)
|
||||
const lastInterval = Math.floor(new Date() / 300000) * 300000
|
||||
const directionArray = ["SingleUp", "DoubleUp", "FortyFiveUp", "Flat", "FortyFiveDown", "SingleDown", "DoubleDown"]
|
||||
return ({
|
||||
console.debug(`metrics/compute/mocks > mocking nightscout api result > ${url}`)
|
||||
const lastInterval = Math.floor(new Date() / 300000) * 300000
|
||||
const directionArray = ["SingleUp", "DoubleUp", "FortyFiveUp", "Flat", "FortyFiveDown", "SingleDown", "DoubleDown"]
|
||||
return ({
|
||||
status:200,
|
||||
data:[{
|
||||
_id:faker.git.commitSha().substring(0, 23),
|
||||
device:"xDrip-DexcomG5",
|
||||
date:lastInterval,
|
||||
dateString:new Date(lastInterval).toISOString(),
|
||||
sgv:faker.random.number({min:40, max:400}),
|
||||
delta:faker.random.number({min:-10, max:10}),
|
||||
direction:directionArray[Math.floor(Math.random() * directionArray.length)],
|
||||
type:"sgv",
|
||||
filtered:0,
|
||||
unfiltered:0,
|
||||
rssi:100,
|
||||
noise:1,
|
||||
sysTime:new Date(lastInterval).toISOString(),
|
||||
utcOffset:faker.random.number({min:-12, max:14})*60,
|
||||
_id:faker.git.commitSha().substring(0, 23),
|
||||
device:"xDrip-DexcomG5",
|
||||
date:lastInterval,
|
||||
dateString:new Date(lastInterval).toISOString(),
|
||||
sgv:faker.random.number({min:40, max:400}),
|
||||
delta:faker.random.number({min:-10, max:10}),
|
||||
direction:directionArray[Math.floor(Math.random() * directionArray.length)],
|
||||
type:"sgv",
|
||||
filtered:0,
|
||||
unfiltered:0,
|
||||
rssi:100,
|
||||
noise:1,
|
||||
sysTime:new Date(lastInterval).toISOString(),
|
||||
utcOffset:faker.random.number({min:-12, max:14})*60,
|
||||
}],
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,8 @@
|
||||
const elements = []
|
||||
let results = new Array(4+faker.random.number(2)).fill(null).map(_ => ({
|
||||
get digital() {
|
||||
return `${this.hours}:${this.minutes}`
|
||||
},
|
||||
return `${this.hours}:${this.minutes}`
|
||||
},
|
||||
hours:faker.random.number(1000), minutes:faker.random.number(1000),
|
||||
name:array ? faker.random.arrayElement(array) : faker.random.words(2).replace(/ /g, "-").toLocaleLowerCase(),
|
||||
percent:0, total_seconds:faker.random.number(1000000),
|
||||
|
||||
Reference in New Issue
Block a user