Skip to content

Commit

Permalink
Component tests and other improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriiHoliuk committed Apr 6, 2022
1 parent bd13bca commit f1523c9
Show file tree
Hide file tree
Showing 11 changed files with 708 additions and 43 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ESLINT_NO_DEV_ERRORS=true
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
/build
/node_modules
/cypress
3 changes: 0 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Uncomment eslint-config-react if you want use react without TS

module.exports = {
extends: ['@mate-academy/eslint-config-react-typescript', 'plugin:cypress/recommended'],
// extends: ['@mate-academy/eslint-config-react', 'plugin:cypress/recommended'],
};
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm start & sleep 5 && npm test
- run: npm run lint
- run: npm test
- name: Upload tests report(cypress mochaawesome merged HTML report)
if: ${{ always() }}
uses: actions/upload-artifact@v2
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea
.vscode
build
dist
node_modules
.DS_Store
yarn.lock
Expand All @@ -10,8 +11,6 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*


raw_reports
cypress/screenshots
cypress/videos
reports
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions cypress.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"baseUrl": "http://localhost:3000",
"video": true,
"pluginsFile": false,
"supportFile": false,
"viewportHeight": 1920,
"viewportWidth": 1080,
"screenshotOnRunFailure": true,
Expand All @@ -12,5 +10,9 @@
"overwrite": false,
"html": false,
"json": true
},
"component": {
"testFiles": "**/*.spec.{js,ts,jsx,tsx}",
"componentFolder": "src"
}
}
1 change: 1 addition & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@mate-academy/cypress-tools/plugins');
1 change: 1 addition & 0 deletions cypress/support/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '@mate-academy/cypress-tools/support';
1 change: 1 addition & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('@mate-academy/cypress-tools/support');
57 changes: 23 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,36 @@
"author": "Mate Academy",
"license": "GPL-3.0",
"dependencies": {
"@types/node": "^12.20.18",
"@types/react": "^17.0.15",
"@types/react-dom": "^17.0.9",
"@cypress/react": "^5.12.4",
"bulma": "^0.9.3",
"node-sass": "^6.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"typescript": "^4.3.5"
"react-scripts": "^5.0.0"
},
"devDependencies": {
"@cypress/webpack-dev-server": "^1.8.4",
"@mate-academy/cypress-tools": "^1.0.4",
"@mate-academy/eslint-config-react": "*",
"@mate-academy/eslint-config-react-typescript": "*",
"@mate-academy/scripts": "^0.9.0",
"@mate-academy/scripts": "^1.1.5",
"@mate-academy/students-ts-config": "*",
"@mate-academy/stylelint-config": "*",
"@mate-academy/eslint-config-react": "*",
"cypress": "^5.6.0",
"@types/node": "^17.0.23",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"cypress": "^9.5.3",
"eslint": "^7.32.0",
"eslint-plugin-cypress": "^2.11.2",
"gh-pages": "^3.2.3",
"husky": "^4.3.8",
"lint-staged": "^11.1.1",
"mochawesome": "^6.2.1",
"mochawesome": "^7.1.3",
"mochawesome-merge": "^4.2.0",
"mochawesome-report-generator": "^5.1.0",
"stylelint": "^13.13.1"
"mochawesome-report-generator": "^6.2.0",
"node-sass": "^7.0.1",
"stylelint": "^13.13.1",
"typescript": "^4.6.3"
},
"scripts": {
"start": "mate-scripts start",
"start": "mate-scripts start -l",
"build": "mate-scripts build",
"test": "mate-scripts test",
"lint-js": "mate-scripts lint -j",
Expand All @@ -43,18 +44,7 @@
"update": "mate-scripts update",
"postinstall": "npm run update",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": "react-app"
},
"lint-staged": {
"*.css": [
"stylelint"
],
"*.js": [
"eslint"
]
"deploy": "mate-scripts deploy"
},
"browserslist": {
"production": [
Expand All @@ -68,13 +58,12 @@
"last 1 safari version"
]
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"mateAcademy": {
"_comment": "Replace 'reactTypescript' with 'react' if you want use React without Typescript",
"projectType": "reactTypescript"
"projectType": "reactTypescript",
"tests": {
"_comment": "Add `cypressComponents: true` to enable component tests",
"cypress": true
}
}
}
}

0 comments on commit f1523c9

Please sign in to comment.