-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1b02c05
commit c89435e
Showing
6 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { keys, map } from 'ramda'; | ||
import { meal, MealType } from '../'; | ||
|
||
test('All meal keys should contain a valid number', () => { | ||
const foodKeys = keys(meal); | ||
map((item: number) => expect(typeof foodKeys[item]).toBe('number')); | ||
}); | ||
|
||
test('Number of default exports equals number of enums', () => { | ||
const enumsCount = Object.keys(MealType).length; | ||
const defaultExportsCount = Object.keys(meal).length; | ||
|
||
expect(defaultExportsCount).toEqual(enumsCount); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import meal from './meal'; | ||
import { MealType } from './meal.enum'; | ||
|
||
export { meal, MealType }; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export enum MealType { | ||
highMeat = 'highMeat', | ||
mediumMeat = 'mediumMeat', | ||
lowMeat = 'lowMeat', | ||
pescetarian = 'pescetarian', | ||
vegetarian = 'vegetarian', | ||
vegan = 'vegan', | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* Unit: kgCO2eq per meal */ | ||
|
||
/* https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4372775/ */ | ||
/* Mean greenhouse gas emissions per 2,000 kcal */ | ||
/* https://globalnews.ca/news/3615212/this-is-what-your-breakfast-lunch-and-dinner-calories-actually-look-like/ */ | ||
/* Human get around 600 calories per meal */ | ||
const highMeat = (7.19 * 600) / 2000; | ||
const mediumMeat = (5.63 * 600) / 2000; | ||
const lowMeat = (4.67 * 600) / 2000; | ||
const pescetarian = (3.91 * 600) / 2000; | ||
const vegetarian = (3.81 * 600) / 2000; | ||
const vegan = (2.89 * 600) / 2000; | ||
|
||
export default { | ||
highMeat, | ||
mediumMeat, | ||
lowMeat, | ||
pescetarian, | ||
vegetarian, | ||
vegan, | ||
}; |