{"id":17746773,"url":"https://github.com/andrekovac/leapyear","last_synced_at":"2026-04-10T20:54:57.147Z","repository":{"id":76129085,"uuid":"292523222","full_name":"andrekovac/LeapYear","owner":"andrekovac","description":"Tiny React Native App which displays whether the current year is a LeapYear","archived":false,"fork":false,"pushed_at":"2021-11-18T23:06:25.000Z","size":27286,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-08-08T02:44:13.763Z","etag":null,"topics":["education","expo","react-native","workshop"],"latest_commit_sha":null,"homepage":"","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/andrekovac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null}},"created_at":"2020-09-03T09:20:31.000Z","updated_at":"2023-08-08T02:44:13.764Z","dependencies_parsed_at":"2023-04-06T09:53:31.698Z","dependency_job_id":null,"html_url":"https://github.com/andrekovac/LeapYear","commit_stats":null,"previous_names":[],"tags_count":11,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrekovac%2FLeapYear","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrekovac%2FLeapYear/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrekovac%2FLeapYear/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrekovac%2FLeapYear/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrekovac","download_url":"https://codeload.github.com/andrekovac/LeapYear/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246586036,"owners_count":20801028,"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":["education","expo","react-native","workshop"],"created_at":"2024-10-26T08:41:56.279Z","updated_at":"2026-04-10T20:54:52.109Z","avatar_url":"https://github.com/andrekovac.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://expo.dev/@andrusch/LeapYear\"\u003e\n    \u003cimg alt=\"Leap Year Logo\" src=\"./assets/LeapYearCalendar.png\" width=\"180\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e\n  LeapYear App\n\u003c/h1\u003e\n\nTiny React Native App which displays whether the current year is a leap year.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"Leap Year App on iOS\" src=\"./docs/LeapYearApp.gif\" width=\"160\" /\u003e\n\u003c/p\u003e\n\n## Run\n\n1. Install dependencies\n\n    ```bash\n      yarn\n    ```\n\n2. Run Expo development server\n\n    ```bash\n    yarn start\n    ```\n\n3. Open the Expo development client on your device. Scan the QR code printed by expo start with Expo Client (Android) or Camera (iOS).\n\n  You may have to wait a minute while your project bundles and loads for the first time.\n\n## Educational purpose\n\nThis app is used as part of a React Native workshop to exercise the following concepts (among others):\n\n- Styling\n- Conditional rendering\n- Testing\n  - Unit tests\n  - Snapshot tests\n  - End-2-end tests with Detox\n- Animations\n- Text Input\n\n## Screens\n\n### Welcome Screen\n\nThis is how the welcome screen looks like on iOS and Android:\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"Welcome Screen iOS\" src=\"./docs/WelcomeScreen_ios.png\" width=\"200\" /\u003e\n    \u003cimg alt=\"Welcome Screen Android\" src=\"./docs/WelcomeScreen_android.png\" width=\"180\" /\u003e\n\u003c/p\u003e\n\n### Home Screen\n\nEnter a year as a 4-digit number. It will be displayed whether the entered year is a leap year.\n\n## End-2-End tests with [Detox](https://github.com/wix/Detox/tree/master/docs)\n\nSeveral End-2-End tests in action:\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"End-2-End tests\" src=\"./docs/DetoxTests.gif\" width=\"400\" /\u003e\n\u003c/p\u003e\n\n**Note**: You will need a Mac which runs OSX for this to work.\n\n1. Install `detox-cli` and required tools globally:\n\n    On a Mac run the following four commands:\n\n    ```bash\n    xcode-select --install\n    brew tap wix/brew\n    brew install applesimutils\n    npm install -g detox-cli\n    ```\n\n2. Switch to the `detox` branch.\n\n    **Note**: Detox was installed using [these instructions from reactnativetesting.io](https://reactnativetesting.io/e2e/setup.html#installing-detox) (excluding the ESLint part)\n\n    Then support for Detox tests written in TypeScript was added with `yarn add --dev ts-jest @types/detox` (loosly following [these instructions](https://gist.github.com/solkaz/ead11515e2aa91d0dc04e609b3108841)).\n\n3. Run the following commands to run the Detox tests:\n\n    1. Install dependencies again. The App on the `detox` branch is an [ejected Expo app](https://docs.expo.io/bare/customizing/) so the dependencies are different as compared to the [managed workflow](https://docs.expo.io/introduction/managed-vs-bare/#managed-workflow).\n\n        ```bash\n        yarn\n        ```\n\n    2. Build the iOS App (only has to be run after adding new packages which have a native part)\n\n         ```bash\n         yarn test:e2e:build\n         ```\n\n    3. Start the iOS Simulator. This can be achieved by just running the app via\n\n        ```\n        yarn ios\n        ```\n\n    4. Run the Detox test cases\n\n         ```bash\n         yarn test:e2e\n         ```\n\n### Record Detox actions\n\nOn the `detox` branch you can record detox end-2-end tests with [DetoxRecorder](https://github.com/wix/DetoxRecorder/). That's how recording looks like:\n\n\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"Detox Recorder in action\" src=\"./docs/DetoxRecorder.gif\" width=\"160\" /\u003e\n\u003c/p\u003e\n\n#### Example\n\nRun the following command in the root folder of the project to start the recorder:\n\n```bash\ndetox recorder --configuration \"ios\" --outputTestFile \"~/Desktop/RecordedTest.e2e.js\" --testName \"My Recorded Test\" --record\n```\n\nIf you hit the start button and type the year `2011` and hit the `Reset` button it will generate the file `~/Desktop/RecordedTest.e2e.js` with contents similar to the following:\n\n```js\ndescribe('Recorded suite', () =\u003e {\n\tit('My Recorded Test', async () =\u003e {\n\t\tawait element(by.id(\"start_button\")).tap();\n\t\tawait element(by.id(\"text_input\")).tap();\n\t\tawait element(by.id(\"text_input\")).replaceText(\"2\");\n\t\tawait element(by.id(\"text_input\")).replaceText(\"20\");\n\t\tawait element(by.id(\"text_input\")).replaceText(\"201\");\n\t\tawait element(by.id(\"text_input\")).replaceText(\"2011\");\n\t\tawait element(by.text(\"Reset\")).tap();\n\t})\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrekovac%2Fleapyear","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrekovac%2Fleapyear","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrekovac%2Fleapyear/lists"}