Compare commits

...

3 Commits

Author SHA1 Message Date
David D'ALMEIDA 6bd2c4a8ce Mise à jour de '.drone.yml'
continuous-integration/drone/push Build was killed Details
2 years ago
David D'ALMEIDA 7d646855c8 Mise à jour de '.drone.yml'
continuous-integration/drone/push Build was killed Details
2 years ago
David D'ALMEIDA 230b8069a7 prepare test/reducers/appReducerTest.ts
continuous-integration/drone/push Build is passing Details
2 years ago

@ -14,7 +14,7 @@ steps:
- cd ./src/FLAD/ - cd ./src/FLAD/
- npm install expo-cli - npm install expo-cli
- npm install - npm install
- npm run - npm run start
- name: code-analysis - name: code-analysis
image: node:latest image: node:latest
@ -24,11 +24,15 @@ steps:
settings: settings:
sources: ./src/FLAD/ sources: ./src/FLAD/
commands: commands:
- cd ./src/FLAD/
- npm install
- npm run test && rm -rf ./test/coverage/lcov-report
- export SONAR_SCANNER_VERSION=4.7.0.2747 - export SONAR_SCANNER_VERSION=4.7.0.2747
- export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux - export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
- curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip - curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
- unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
- export PATH=$SONAR_SCANNER_HOME/bin:$PATH - export PATH=$SONAR_SCANNER_HOME/bin:$PATH
- export SONAR_SCANNER_OPTS="-server" - export SONAR_SCANNER_OPTS="-server"
- sonar-scanner -D sonar.projectKey=FLAD -D sonar.sources=. -D sonar.host.url=https://codefirst.iut.uca.fr/sonar - sonar-scanner -D sonar.projectKey=FLAD -D sonar.sources=. -D sonar.host.url=https://codefirst.iut.uca.fr/sonar -D sonar.javascript.lcov.reportPaths=./test/coverage/lcov.info -D sonar.testExecutionReportPaths=./test/coverage/testlog.xml
depends_on: [ app-build ] depends_on: [ app-build ]

@ -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