{"id":18457628,"url":"https://github.com/amwebexpert/demo-react-context-with-jest","last_synced_at":"2025-04-22T23:20:13.217Z","repository":{"id":222040270,"uuid":"756079613","full_name":"amwebexpert/demo-react-context-with-jest","owner":"amwebexpert","description":"React Context + Jest unit testing strategies","archived":false,"fork":false,"pushed_at":"2024-02-12T23:37:27.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T15:16:21.322Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amwebexpert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-11T22:50:29.000Z","updated_at":"2024-02-11T22:52:44.000Z","dependencies_parsed_at":"2024-02-11T23:35:11.869Z","dependency_job_id":"42fd68da-7d71-43c5-86c2-8fc21bac7248","html_url":"https://github.com/amwebexpert/demo-react-context-with-jest","commit_stats":null,"previous_names":["amwebexpert/demo-react-context-with-jest"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amwebexpert%2Fdemo-react-context-with-jest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amwebexpert%2Fdemo-react-context-with-jest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amwebexpert%2Fdemo-react-context-with-jest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amwebexpert%2Fdemo-react-context-with-jest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amwebexpert","download_url":"https://codeload.github.com/amwebexpert/demo-react-context-with-jest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250338287,"owners_count":21414155,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T08:15:11.144Z","updated_at":"2025-04-22T23:20:13.191Z","avatar_url":"https://github.com/amwebexpert.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React + TypeScript + Vite\n\nWebapp sandbox project for:\n\n- React experiments\n- Typescript experiments\n- Jest testing strategies proofs of concept\n\n## References\n\n- [Component testing](https://www.alexhyett.com/unit-testing-vs-integration-testing/#component-tests)\n- [Unit testing](https://www.alexhyett.com/unit-testing-vs-integration-testing/#unit-tests)\n- Mocking techniques:\n  - https://nancyhuynh-til.netlify.app/jest-mocking-useContext/\n  - https://polvara.me/posts/mocking-context-with-react-testing-library\n  - https://thoughtbot.com/blog/mocking-react-components-with-jest\n  - https://medium.com/@taylormclean15/jest-testing-mocking-child-components-to-make-your-unit-tests-more-concise-18691ef6a0c2\n  - https://stackoverflow.com/a/72450016/704681\n\n\n## Project commands and settings\n\nProject created with Vite.js with typescript support\n\n  `yarn create vite demo-react-context-with-jest --template react-ts`\n\nCommands:\n\n  `yarn dev`\n\nFor setting up Jest tests:\n\n- [Installing Jest for Testing in Your Vite-React TS project](https://dev.to/hannahadora/jest-testing-with-vite-and-react-typescript-4bap)\n\n\nThis template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.\n\nCurrently, two official plugins are available:\n\n- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh\n- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh\n\n## Expanding the ESLint configuration\n\nIf you are developing a production application, we recommend updating the configuration to enable type aware lint rules:\n\n- Configure the top-level `parserOptions` property like this:\n\n```js\nexport default {\n  // other rules...\n  parserOptions: {\n    ecmaVersion: 'latest',\n    sourceType: 'module',\n    project: ['./tsconfig.json', './tsconfig.node.json'],\n    tsconfigRootDir: __dirname,\n  },\n}\n```\n\n- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`\n- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`\n- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` \u0026 `plugin:react/jsx-runtime` to the `extends` list\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famwebexpert%2Fdemo-react-context-with-jest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famwebexpert%2Fdemo-react-context-with-jest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famwebexpert%2Fdemo-react-context-with-jest/lists"}