{"id":13767352,"url":"https://github.com/fnky/react-nodegui-testing-library","last_synced_at":"2025-10-24T10:16:08.546Z","repository":{"id":43973906,"uuid":"248531951","full_name":"fnky/react-nodegui-testing-library","owner":"fnky","description":"Simple React NodeGui testing utilities that encourage good testing practices.","archived":false,"fork":false,"pushed_at":"2023-01-05T16:39:20.000Z","size":778,"stargazers_count":8,"open_issues_count":16,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T00:39:09.519Z","etag":null,"topics":["javascript","nodegui","react-nodegui","testing","typescript"],"latest_commit_sha":null,"homepage":"https://fnky.github.io/react-nodegui-testing-library","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fnky.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-19T15:01:36.000Z","updated_at":"2023-03-10T11:05:45.000Z","dependencies_parsed_at":"2023-02-04T07:15:18.564Z","dependency_job_id":null,"html_url":"https://github.com/fnky/react-nodegui-testing-library","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnky%2Freact-nodegui-testing-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnky%2Freact-nodegui-testing-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnky%2Freact-nodegui-testing-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fnky%2Freact-nodegui-testing-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fnky","download_url":"https://codeload.github.com/fnky/react-nodegui-testing-library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253492529,"owners_count":21916959,"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":["javascript","nodegui","react-nodegui","testing","typescript"],"created_at":"2024-08-03T16:01:07.798Z","updated_at":"2025-10-24T10:16:03.504Z","avatar_url":"https://github.com/fnky.png","language":"TypeScript","readme":"\u003cdiv align='center'\u003e\n  \u003ca href=\"https://www.emojione.com/emoji/1f98B\"\u003e\n    \u003cimg\n      height=\"80\"\n      width=\"80\"\n      alt=\"butterfly\"\n      src=\"https://raw.githubusercontent.com/fnky/react-nodegui-testing-library/master/other/butterfly.png\"\n    /\u003e\n  \u003c/a\u003e\n  \n  \u003ch1\u003eReact NodeGui Testing Library\u003c/h1\u003e\n\n  \u003cp\u003eSimple React NodeGui testing utilities that encourage good testing\npractices.\u003c/P\u003e\n\n  \u003cbr /\u003e\n\n[**Read The Docs**](https://fnky.github.io/react-nodegui-testing-library)\n\n\u003c/div\u003e\n\n\u003c!-- prettier-ignore-start --\u003e\n[![Build Status][build-badge]][build]\n[![version][version-badge]][package] [![downloads][downloads-badge]][npmtrends]\n[![MIT License][license-badge]][license]\n\n\u003c!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --\u003e\n[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)\n\u003c!-- ALL-CONTRIBUTORS-BADGE:END --\u003e\n\n[![Watch on GitHub][github-watch-badge]][github-watch]\n[![Star on GitHub][github-star-badge]][github-star]\n\u003c!-- prettier-ignore-end --\u003e\n\n## The problem\n\nYou want to write maintainable tests for your [React\nNodeGui](https://github.com/nodegui/react-nodegui) components testing without\nimplementation details and rather focus on making your tests give you the\nconfidence for which they are intended.\n\n## This solution\n\nThe `react-nodegui-testing-library` is a very lightweight solution for testing\nReact NodeGui components. It provides light utility functions on top of\n`react-test-renderer`, in a way that encourages better testing practices.\n\nThe project is heavily based on [`react-native-testing-library`](https://github.com/callstack/react-native-testing-library)\n\n## Installation\n\nThis module is distributed via [npm][npm] which is bundled with [node][node] and\nshould be installed as one of your project's `devDependencies`:\n\n```bash\nyarn install --dev react-nodegui-testing-library\n# or\nnpm install --save-dev react-nodegui-testing-library\n```\n\nThis library has `peerDependencies` listings for `react`, `@nodegui/react-nodegui` and\n`react-test-renderer`.\n\n\u003e [**Docs**](https://fnky.github.io/react-nodegui-testing-library)\n\n## Example\n\n```tsx\nimport React from 'react'\nimport { View, Text, Button, useEventHandler } from '@nodegui/react-nodegui'\n\nexport const HiddenMessage: React.FC = ({ children }) =\u003e {\n  const [showMessage, setShowMessage] = React.useState(false);\n\n  return (\n    \u003cView\u003e\n      \u003cButton\n        on={clicked: () =\u003e {\n          setShowMessage(prevShowMessage =\u003e !!prevShowMessage)\n        }}\n        text=\"Show Message\"\n      /\u003e\n      {showMessage ? children : null}\n    \u003c/View\u003e\n  )\n}\n\n// __tests__/hidden-message.test.ts\nimport { render, fireEvent } from 'react-nodegui-testing-library';\nimport { HiddenMessage } from '../HiddenMessage';\n\ntest('toggles the children when the button is clicked', () =\u003e {\n  const testMessage = 'Test Message';\n  const { getByText, queryByText } = render(\n    \u003cHiddenMessage\u003e\n      \u003cText\u003e{testMessage}\u003c/Text\u003e\n    \u003c/HiddenMessage\u003e\n  );\n\n  // query* functions will return the element or null if it cannot be found\n  // get* functions will return the element or throw an error if it cannot be found\n  expect(queryByText(testMessage)).toBeNull();\n\n  // the queries can accept a regex to make your selectors more resilient to content tweaks and changes.\n  fireEvent.click(getByText(/show/i));\n\n  expect(getByText(testMessage)).toBeDefined();\n});\n```\n\n## Docs\n\n[**Read The Docs**](https://fnky.github.io/react-nodegui-testing-library)\n\n## Contributors\n\nThanks goes to these people ([emoji key][emojis]):\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore-start --\u003e\n\u003c!-- markdownlint-disable --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://cbp.io\"\u003e\u003cimg src=\"https://avatars1.githubusercontent.com/u/995050?v=4\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003eChristian Petersen\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003cbr /\u003e\u003ca href=\"https://github.com/fnky/react-nodegui-testing-library/commits?author=fnky\" title=\"Code\"\u003e💻\u003c/a\u003e \u003ca href=\"https://github.com/fnky/react-nodegui-testing-library/commits?author=fnky\" title=\"Documentation\"\u003e📖\u003c/a\u003e \u003ca href=\"#infra-fnky\" title=\"Infrastructure (Hosting, Build-Tools, etc)\"\u003e🚇\u003c/a\u003e \u003ca href=\"https://github.com/fnky/react-nodegui-testing-library/commits?author=fnky\" title=\"Tests\"\u003e⚠️\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- markdownlint-enable --\u003e\n\u003c!-- prettier-ignore-end --\u003e\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e\n\nThis project follows the [all-contributors][all-contributors] specification.\nContributions of any kind welcome!\n\n## LICENSE\n\n[MIT](LICENSE)\n\n\u003c!-- prettier-ignore-start --\u003e\n[npm]: https://www.npmjs.com/\n[node]: https://nodejs.org\n[build-badge]: https://github.com/fnky/react-nodegui-testing-library/workflows/Tests/badge.svg?style=flat-square\n[build]: https://github.com/fnky/react-nodegui-testing-library\n[version-badge]: https://img.shields.io/npm/v/react-nodegui-testing-library.svg?style=flat-square\n[package]: https://www.npmjs.com/package/react-nodegui-testing-library\n[downloads-badge]: https://img.shields.io/npm/dm/react-nodegui-testing-library.svg?style=flat-square\n[npmtrends]: http://www.npmtrends.com/react-nodegui-testing-library\n[license-badge]: https://img.shields.io/npm/l/react-nodegui-testing-library.svg?style=flat-square\n[license]: https://github.com/fnky/react-nodegui-testing-library/blob/master/LICENSE\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\n[prs]: http://makeapullrequest.com\n[github-watch-badge]: https://img.shields.io/github/watchers/fnky/react-nodegui-testing-library.svg?style=social\n[github-watch]: https://github.com/fnky/react-nodegui-testing-library/watchers\n[github-star-badge]: https://img.shields.io/github/stars/fnky/react-nodegui-testing-library.svg?style=social\n[github-star]: https://github.com/fnky/react-nodegui-testing-library/stargazers\n[emojis]: https://github.com/all-contributors/all-contributors#emoji-key\n[all-contributors]: https://github.com/all-contributors/all-contributors\n[bugs]: https://github.com/fnky/react-nodegui-testing-library/issues?q=is%3Aissue+is%3Aopen+label%3Abug+sort%3Acreated-desc\n[requests]: https://github.com/fnky/react-nodegui-testing-library/issues?q=is%3Aissue+sort%3Areactions-%2B1-desc+label%3Aenhancement+is%3Aopen\n[good-first-issue]: https://github.com/fnky/react-nodegui-testing-library/issues?utf8=✓\u0026q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc+label%3A\"good+first+issue\"+\n[stackoverflow]: https://stackoverflow.com/questions/tagged/react-nodegui-testing-library\n\n\u003c!-- prettier-ignore-end --\u003e\n","funding_links":[],"categories":["Tools"],"sub_categories":["Samples and Experiments"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnky%2Freact-nodegui-testing-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffnky%2Freact-nodegui-testing-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffnky%2Freact-nodegui-testing-library/lists"}