feat: add first test for services

WORK-RRE
Rémi REGNAULT 1 year ago
parent 3a58d2b186
commit 1b9746a0b5

@ -1,30 +0,0 @@
export default class Profil {
private _name: string;
private _avatar: string;
private _allergy: string[];
private _diets: string[];
constructor( name: string, avatar: string, allergy: string[], diets: string[]) {
this._name = name;
this._avatar = avatar;
this._allergy = allergy;
this._diets = diets;
}
get name(): string {
return this._name;
}
get avatar(): string{
return this._avatar;
}
get allergy(): string[]{
return this._allergy;
}
get diets(): string[]{
return this._diets;
}
}

@ -0,0 +1,11 @@
import IngredientService from '../Services/Ingredients/IngredientsServices';
describe('IngredientService', () => {
const ingredient_service = new IngredientService();
it('should get one ingredient', async () => {
const ingredient_service = new IngredientService();
const result = await ingredient_service.getIngredientById(1)
expect(result.id).toBe(1);
});
});

File diff suppressed because it is too large Load Diff

@ -6,7 +6,8 @@
"start": "expo start --dev-client",
"android": "expo run:android",
"ios": "expo run:ios",
"web": "expo start --web"
"web": "expo start --web",
"test": "jest --coverage"
},
"dependencies": {
"@expo/webpack-config": "^19.0.0",
@ -18,6 +19,7 @@
"axios": "^1.6.2",
"expo": "~49.0.15",
"expo-blur": "^12.4.1",
"expo-image-picker": "~14.3.2",
"expo-linear-gradient": "~12.3.0",
"expo-splash-screen": "~0.20.5",
"expo-status-bar": "~1.6.0",
@ -31,11 +33,12 @@
"react-native-splash-screen": "^3.3.0",
"react-native-virtualized-view": "^1.0.0",
"react-native-web": "~0.19.6",
"typescript": "^5.1.3",
"expo-image-picker": "~14.3.2"
"typescript": "^5.1.3"
},
"devDependencies": {
"@babel/core": "^7.20.0"
"@babel/core": "^7.20.0",
"@types/jest": "^29.5.11",
"jest": "^29.7.0"
},
"private": true
}

8723
package-lock.json generated

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save