-
Notifications
You must be signed in to change notification settings - Fork 24
/
jest.setup.ts
39 lines (32 loc) · 1.25 KB
/
jest.setup.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { DataSourceType, MeasureUnitType } from "@data-at-hand/core/measure/DataSourceSpec";
import { NLUOptions } from "@core/speech/nlp/types";
export const STEP_COUNT_GOAL = 10000
export const HOURS_SLEPT_GOAL = 5 * 3600
export const WEIGHT_GOAL = 70
export const TODAY = 20200301 // today is 2020 3/1
export const DATA_INITIAL_DATE = 20151013
console.log = jest.fn()
console.debug = jest.fn()
export const dataSources = [
["step count", DataSourceType.StepCount],
["steps", DataSourceType.StepCount],
["weight", DataSourceType.Weight],
["heart rate", DataSourceType.HeartRate],
["sleep range", DataSourceType.SleepRange],
["sleep schedule", DataSourceType.SleepRange],
["hours slept", DataSourceType.HoursSlept],
["sleep length", DataSourceType.HoursSlept],
]
export const speechOptions = {
getToday: () => new Date(2020, 2, 1), // today is 2020 3/1
getGoal: async (dataSourceType: DataSourceType) => {
switch(dataSourceType){
case DataSourceType.StepCount: return STEP_COUNT_GOAL
case DataSourceType.HoursSlept: return HOURS_SLEPT_GOAL
case DataSourceType.Weight: return WEIGHT_GOAL
default: return null
}
},
dataInitialDate: DATA_INITIAL_DATE,
measureUnit: MeasureUnitType.Metric,
} as NLUOptions