{"id":20991331,"url":"https://github.com/adityachandak287/unit-testing-demo","last_synced_at":"2025-03-13T12:19:07.652Z","repository":{"id":61105184,"uuid":"547200020","full_name":"adityachandak287/unit-testing-demo","owner":"adityachandak287","description":"Repository for Unit Testing Presentation","archived":false,"fork":false,"pushed_at":"2022-10-09T20:15:53.000Z","size":734,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-20T08:13:16.856Z","etag":null,"topics":["testing","unit-testing"],"latest_commit_sha":null,"homepage":"https://replit.com/@AdityaChandakDQ/unit-testing-demo","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/adityachandak287.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}},"created_at":"2022-10-07T09:43:19.000Z","updated_at":"2023-02-13T17:10:30.000Z","dependencies_parsed_at":"2022-10-10T17:17:39.437Z","dependency_job_id":null,"html_url":"https://github.com/adityachandak287/unit-testing-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityachandak287%2Funit-testing-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityachandak287%2Funit-testing-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityachandak287%2Funit-testing-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adityachandak287%2Funit-testing-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adityachandak287","download_url":"https://codeload.github.com/adityachandak287/unit-testing-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243401514,"owners_count":20285060,"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":["testing","unit-testing"],"created_at":"2024-11-19T06:38:23.049Z","updated_at":"2025-03-13T12:19:07.626Z","avatar_url":"https://github.com/adityachandak287.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unit Testing Demo\n\n## Commands\n\nRun tests\n\n```\nnpm run test\n```\n\nRun tests in watch mode\n\n```\nnpm run test:watch\n```\n\nRun tests in watch mode and serve coverage report\n\n```\nnpm run test-and-serve\n```\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003ch2\u003eAPI documentation\u003c/h2\u003e\u003c/summary\u003e\n\n### GET /hello\n\n```json\n{ \"msg\": \"Hello World\" }\n```\n\n### GET /\n\nGet all users\n\n```json\n[\n  {\n    \"id\": 1,\n    \"name\": \"test\",\n    \"email\": \"test@example.com\"\n  }\n]\n```\n\n### GET /\u003cid\u003e\n\nGet user by id\n\n```json\n{\n  \"id\": 3,\n  \"name\": \"test\",\n  \"email\": \"test@example.com\"\n}\n\n// Error Response if user does not exist\n{\n  \"statusCode\": 404,\n  \"message\": \"Not Found\"\n}\n```\n\n### POST /\n\nCreate user\n\n```json\n// Request Body\n{\n  \"name\": \"John Doe\",\n  \"email\": \"johndoe@example.com\"\n}\n\n// Response\n{\n  \"id\": 2,\n  \"name\": \"John Doe\",\n  \"email\": \"johndoe@example.com\"\n}\n\n// Error Response\n{\n  \"statusCode\": 400,\n  \"message\": \"Bad Request\"\n}\n```\n\n### PATCH /\u003cid\u003e\n\nCreate user\n\n```json\n// Request Body\n{\n  \"name\": \"John Cena\"\n}\n\n// Response\n{ \"success\": true }\n\n// Error Response\n// If update fails\n{\n  \"statusCode\": 400,\n  \"message\": \"Bad Request\"\n}\n// If user does not exist\n{\n  \"statusCode\": 404,\n  \"message\": \"Not Found\"\n}\n```\n\n### DELETE /\u003cid\u003e\n\nDelete user by id\n\n```json\n// Response\n{ \"success\": true }\n\n// Error Response if user does not exist\n{\n  \"statusCode\": 404,\n  \"message\": \"Not Found\"\n}\n```\n\n### POST /pay\n\nVerify if payment in given currency is valid for given amount in INR\n\n```json\n// Request Body\n{\n  \"amountPaid\": 10,\n  \"currency\": \"USD\",\n  \"inrToPay\": 500\n}\n\n// Response\n{ \"success\": true }\n\n// Error Response\n// If currency is not valid\n{\n    \"statusCode\": 400,\n  \"message\": \"Invalid currency\",\n  \"error\": \"Bad Request\"\n}\n\n// If given currency amount converted to INR is not \u003e= inrToPay\n{\n  \"statusCode\": 400,\n  \"message\": \"Insufficient amount\",\n  \"error\": \"Bad Request\"\n}\n```\n\n\u003c/details\u003e\n\n## Credits\n\n- [Currency API](https://github.com/fawazahmed0/currency-api)\n\n## Resources\n\n- [Prisma Docs - Testing](https://www.prisma.io/docs/guides/testing/unit-testing)\n- [NestJS Docs - Testing](https://docs.nestjs.com/fundamentals/testing)\n- [Jest Docs](https://jestjs.io/docs/28.x/getting-started)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityachandak287%2Funit-testing-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadityachandak287%2Funit-testing-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadityachandak287%2Funit-testing-demo/lists"}