Created
February 4, 2021 17:42
-
-
Save alvinslee/8971f6b1dc3877b223528bd92a472685 to your computer and use it in GitHub Desktop.
A module for preparing test data - with code duplication removed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
addTimestamps, | |
truncateLocations | |
} = require('./testHelpers') | |
const KEYS = [ | |
'userData', | |
'deviceTypes', | |
'nutritionPlans', | |
'exerciseRoutine', | |
'goals', | |
'miniChallenges', | |
'rewards' | |
] | |
export function prepare() => { | |
const result = {} | |
for (const key of KEYS) { | |
result[key] = require(`./testData/${key}.json`) | |
truncateLocations(result[key]) | |
addTimestamps(result[key]) | |
} | |
return result | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment