prepare test/reducers/appReducerTest.ts
continuous-integration/drone/push Build is passing Details

jest_Test
David D'ALMEIDA 2 years ago
parent 216d95b637
commit 230b8069a7

@ -4,10 +4,29 @@
"main": "node_modules/expo/AppEntry.js", "main": "node_modules/expo/AppEntry.js",
"scripts": { "scripts": {
"start": "expo start", "start": "expo start",
"test": "jest",
"android": "expo start --android", "android": "expo start --android",
"ios": "expo start --ios", "ios": "expo start --ios",
"web": "expo start --web" "web": "expo start --web"
}, },
"jest": {
"preset": "jest-expo",
"verbose": true,
"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native|@react-native(-community)?)|expo(nent)?|@expo(nent)?/.*|@expo-google-fonts/.*|react-navigation|@react-navigation/.*|@unimodules/.*|unimodules|sentry-expo|native-base|react-native-svg)"
],
"testMatch": [
"**.test.js"
],
"testEnvironment": "node",
"testEnvironmentOptions": {
"browsers": [
"chrome",
"firefox",
"safari"
]
}
},
"dependencies": { "dependencies": {
"@react-native-async-storage/async-storage": "^1.17.11", "@react-native-async-storage/async-storage": "^1.17.11",
"@react-navigation/bottom-tabs": "^6.5.4", "@react-navigation/bottom-tabs": "^6.5.4",
@ -48,7 +67,8 @@
"react-navigation-shared-element": "^3.1.3", "react-navigation-shared-element": "^3.1.3",
"react-redux": "^8.0.5", "react-redux": "^8.0.5",
"redux": "^4.2.1", "redux": "^4.2.1",
"expo-web-browser": "~12.0.0" "expo-web-browser": "~12.0.0",
"jest": "^26.6.3"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.12.9", "@babel/core": "^7.12.9",

@ -0,0 +1,28 @@
// import Music from "../../Model/Music";
// import { Spot } from "../../Model/Spot";
// import appReducer from "../../redux/reducers/appReducer";
// describe('test app reducer', () => {
// let initialState = {
// spot: [] as Spot[],
// favoriteMusic: [] as Music[],
// userCurrentMusic: null
// }
// it('should return initial state', () => {
// expect(appReducer(undefined, {})).toEqual(initialState);
// });
// it('should handle ADD_FAVORITE_NOUNOURS', () => {
// const nounours = new Spot("Chewie", 42, 10000, "https://monuri.png");
// expect(
// appReducer(initialState, {
// type: 'ADD_FAVORITE_NOUNOURS',
// nounours,
// })
// ).toEqual({
// nounours: [],
// favoriteNounours: [nounours],
// });
// });
Loading…
Cancel
Save