diff --git a/.env b/.env new file mode 100644 index 000000000..169090b7e --- /dev/null +++ b/.env @@ -0,0 +1,3 @@ +REACT_APP_GOOGLE_API_KEY=AIzaSyDN0P1UB4W39-XdmmA9wniCAlXA0f3WprU +REACT_APP_YOUTUBE_API_V3_SEARCH_URL=https://www.googleapis.com/youtube/v3/search +REACT_APP_YOUTUBE_API_V3_VIDEOS_URL=https://www.googleapis.com/youtube/v3/videos \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index 064b2ce08..39a60234a 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,5 +5,6 @@ "semi": true, "singleQuote": true, "jsxSingleQuote": false, - "arrowParens": "always" -} + "arrowParens": "always", + "endOfLine": "auto" +} \ No newline at end of file diff --git a/babel.config.json b/babel.config.json new file mode 100644 index 000000000..860e155a9 --- /dev/null +++ b/babel.config.json @@ -0,0 +1,4 @@ +{ + "plugins": ["@babel/plugin-transform-react-jsx"], + "presets": ["@babel/env", "@babel/react"] +} \ No newline at end of file diff --git a/coverage.txt b/coverage.txt new file mode 100644 index 000000000..2fc7fe019 --- /dev/null +++ b/coverage.txt @@ -0,0 +1,13 @@ +--------------------------------|----------|----------|----------|----------|----------------| +File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines | +--------------------------------|----------|----------|----------|----------|----------------| + CardHomePreview\ | 100 | 100 | 100 | 100 | | + CardHomePreview.component.jsx | 100 | 100 | 100 | 100 | | + index.js | 100 | 100 | 100 | 100 | | + VideoListHome\ | 100 | 100 | 100 | 100 | | + VideoListHome.component.jsx | 100 | 100 | 100 | 100 | | +--------------------------------|----------|----------|----------|----------|----------------| +All files | 100 | 100 | 100 | 100 | | +--------------------------------|----------|----------|----------|----------|----------------| + +Done diff --git a/package.json b/package.json index 5bc0e0d0d..8b823e18a 100644 --- a/package.json +++ b/package.json @@ -6,21 +6,28 @@ "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^10.4.9", "@testing-library/user-event": "^12.1.3", + "enzyme": "^3.11.0", + "enzyme-adapter-react-16": "^1.15.6", + "istanbul": "^0.4.5", + "jest-cli": "^26.6.3", "react": "^16.13.1", "react-dom": "^16.13.1", "react-router": "^5.2.0", "react-router-dom": "^5.2.0", - "react-scripts": "3.4.3" + "react-scripts": "3.4.3", + "react-transition-group": "^4.4.1", + "styled-components": "^5.2.1" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", - "test": "react-scripts test", + "test": "jest --coverage && istanbul report --include coverage/coverage-final.json text > coverage.txt", "eject": "react-scripts eject", "lint": "eslint ./src --ext .js,.jsx", "lint:fix": "eslint ./src --ext .js,.jsx --fix" }, "devDependencies": { + "@babel/plugin-transform-react-jsx": "^7.12.17", "eslint-config-airbnb": "^18.2.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-eslint-comments": "^3.2.0", @@ -57,5 +64,20 @@ "hooks": { "pre-commit": "lint-staged" } + }, + "jest": { + "coveragePathIgnorePatterns": [ + "/node_modules/", + "/src/index.js" + ], + "coverageThreshold": { + "global": { + "statements": 60, + "branches": 60, + "lines": 60, + "functions": 60 + } + }, + "coverageReporters": ["json"] } } diff --git a/public/index.html b/public/index.html index 6a9f8c26b..e0fba50f8 100644 --- a/public/index.html +++ b/public/index.html @@ -21,10 +21,14 @@ work correctly both with client-side routing and a non-root public URL. Learn how to configure a non-root public URL by running `npm run build`. --> -