{"id":20208034,"url":"https://github.com/gkampitakis/mongodb-jest-testing","last_synced_at":"2025-09-22T00:31:15.324Z","repository":{"id":45414361,"uuid":"410374721","full_name":"gkampitakis/mongodb-jest-testing","owner":"gkampitakis","description":"Tests with jest and mongodb","archived":false,"fork":false,"pushed_at":"2021-12-14T22:48:03.000Z","size":66,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T11:22:07.778Z","etag":null,"topics":["docker-compose","jest","learning-by-doing","mongodb","testing","typescript"],"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/gkampitakis.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":"2021-09-25T20:24:34.000Z","updated_at":"2024-10-11T13:35:37.000Z","dependencies_parsed_at":"2022-08-30T19:10:38.677Z","dependency_job_id":null,"html_url":"https://github.com/gkampitakis/mongodb-jest-testing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gkampitakis/mongodb-jest-testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkampitakis%2Fmongodb-jest-testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkampitakis%2Fmongodb-jest-testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkampitakis%2Fmongodb-jest-testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkampitakis%2Fmongodb-jest-testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gkampitakis","download_url":"https://codeload.github.com/gkampitakis/mongodb-jest-testing/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gkampitakis%2Fmongodb-jest-testing/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276328897,"owners_count":25623323,"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","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["docker-compose","jest","learning-by-doing","mongodb","testing","typescript"],"created_at":"2024-11-14T05:33:51.154Z","updated_at":"2025-09-22T00:31:15.024Z","avatar_url":"https://github.com/gkampitakis.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mongodb and Jest Testing\n\n[![Ask Me Anything !](https://img.shields.io/badge/Ask%20me-anything-1abc9c.svg)](https://twitter.com/g_kampitakis)\n\nHow to test code that uses mongodb as storage.\n\n## Description\n\nI have created a `UserService` class which interacts with mongodb for\n`creating`, `retrieving`, `updating` and `deleting` resources in `users`\ncollection. So in this repository explore different ways of testing the\nfunctionality of that service.\n\n## Development\n\n### Prerequisites\n\n- `yarn` or `npm` installed.\n- Latest `nodejs` installed.\n- Docker installed.\n\n### Run\n\nIn order to run tests locally you need\n\n- Run `yarn` or `npm install` for installing dependencies\n- Execute tests\n  - For mocks `yarn test:mock` or `npm run test:mock`\n  - For docker `yarn test:docker` or `npm run test:docker`\n  - For mongodb-memory-server `yarn test:memory` or `npm run test:memory`\n\n## Useful commands\n\n- Run jest in watch mode `yarn test:mock --watchAll`, useful for when writing\n  tests.\n- Run docker compose from root folder\n  `docker-compose -f ./docker-method/docker-compose.yaml \u003ccommand\u003e \u003cflags\u003e`\n\n## License\n\nMIT License\n\n\u003cp align=\"center\"\u003e\n✌️ \u003ca href=\"https://github.com/gkampitakis/mongodb-jest-testing/issues/new\"\u003eFor any questions or issues\u003c/a\u003e ✌️\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkampitakis%2Fmongodb-jest-testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgkampitakis%2Fmongodb-jest-testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgkampitakis%2Fmongodb-jest-testing/lists"}