Added basic jest tests

This commit is contained in:
Arnaud Vergnet 2020-03-20 22:31:27 +01:00
parent 3bc45704f6
commit b0094716be
2 changed files with 20 additions and 2 deletions

View file

@ -5,7 +5,13 @@
"android": "expo start --android", "android": "expo start --android",
"ios": "expo start --ios", "ios": "expo start --ios",
"web": "expo start --web", "web": "expo start --web",
"eject": "expo eject" "eject": "expo eject",
"test": "jest",
"testw": "jest --watch",
"testc": "jest --coverage"
},
"jest": {
"preset": "react-native"
}, },
"dependencies": { "dependencies": {
"@expo/vector-icons": "~10.0.0", "@expo/vector-icons": "~10.0.0",
@ -38,7 +44,9 @@
"expo-linear-gradient": "~8.0.0" "expo-linear-gradient": "~8.0.0"
}, },
"devDependencies": { "devDependencies": {
"babel-preset-expo": "^8.0.0" "babel-preset-expo": "^8.0.0",
"jest": "^25.1.0",
"react-test-renderer": "^16.13.1"
}, },
"private": true "private": true
} }

View file

@ -0,0 +1,10 @@
import React from 'react';
import PlanningEventManager from "../PlanningEventManager";
test('time test', () => {
expect(PlanningEventManager.formatTime("1:2")).toBe("1:2");
});
test('time test 2', () => {
expect(PlanningEventManager.formatTime("1:2")).toBe("2:2");
});