Skip to content

Instantly share code, notes, and snippets.

@alvinslee
Last active February 4, 2021 17:41
Show Gist options
  • Save alvinslee/acdfacb5a51ee9a07bd7b00b3f9ddd06 to your computer and use it in GitHub Desktop.
Save alvinslee/acdfacb5a51ee9a07bd7b00b3f9ddd06 to your computer and use it in GitHub Desktop.
A module for preparing test data - loading result object via a for loop
const KEYS = [
'userData',
'deviceTypes',
'nutritionPlans',
'exerciseRoutine',
'goals',
'miniChallenges',
'rewards'
]
const result = {}
for (const key of KEYS) {
result[key] = require(`./testData/${key}.json`)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment