{"id":17942724,"url":"https://github.com/b1f6c1c4/jest-mongoose","last_synced_at":"2025-07-14T23:10:40.345Z","repository":{"id":29759937,"uuid":"122709114","full_name":"b1f6c1c4/jest-mongoose","owner":"b1f6c1c4","description":"Mongoose integration test made easy and terse.","archived":false,"fork":false,"pushed_at":"2023-06-12T12:57:40.000Z","size":722,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-27T14:46:58.347Z","etag":null,"topics":["integration-testing","javascript","jest","jest-mongoose","mongodb","mongoose","testing","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/b1f6c1c4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2018-02-24T06:07:48.000Z","updated_at":"2022-11-08T17:18:19.000Z","dependencies_parsed_at":"2024-08-23T01:13:42.077Z","dependency_job_id":"a4e12203-560f-4e95-9897-f72ae9eaaa88","html_url":"https://github.com/b1f6c1c4/jest-mongoose","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/b1f6c1c4/jest-mongoose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b1f6c1c4%2Fjest-mongoose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b1f6c1c4%2Fjest-mongoose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b1f6c1c4%2Fjest-mongoose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b1f6c1c4%2Fjest-mongoose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b1f6c1c4","download_url":"https://codeload.github.com/b1f6c1c4/jest-mongoose/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b1f6c1c4%2Fjest-mongoose/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265365997,"owners_count":23753432,"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":["integration-testing","javascript","jest","jest-mongoose","mongodb","mongoose","testing","unit-testing"],"created_at":"2024-10-29T03:06:59.081Z","updated_at":"2025-07-14T23:10:40.302Z","avatar_url":"https://github.com/b1f6c1c4.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jest-mongoose\n\n[![Appveyor Build](https://img.shields.io/appveyor/build/b1f6c1c4/jest-mongoose?style=flat-square)](https://ci.appveyor.com/project/b1f6c1c4/jest-mongoose)\n\n\u003e Mongoose integration test made easy and terse.\n\nThis package helps you do mongoose integration test at ease.\n\n* Easy to use. Terse and intuitive API.\n* MongoDB connection is managed by yourself.\n* No giant binary dependencies like `mongodb-download`.\n\n## Pre-requisites\n\nThis module requires Jest and Mongoose.\n\n## Installation\n\n```sh\n$ npm i --save-dev jest-mongoose\n```\n## Usage\n\n\u003e For a complete working demo, see the `example` folder.\n\n```js\nconst { models, make, mer, check } = require('./bundle');\nconst { createUser } = require('../userManagement');\n\ndescribe('createUser', () =\u003e {\n  it('should make a new user', async () =\u003e {\n    // Call the function to be tested\n    await createUser();\n    // Check if the result is correct\n    await check.User({\n      _id: 'the-id',\n      name: 'the-name',\n    });\n  });\n\n  it('should handle duplication insertion', async () =\u003e {\n    // Setup database records is simple\n    await make.User({\n      _id: 'the-id',\n      name: 'my-name-is-evil',\n    });\n    const result = await createUser();\n    // Check the return value\n    expect(result).toBeInstanceOf(Error);\n    // Check the previous record is intact\n    await check.User({\n      _id: 'the-id',\n      name: 'my-name-is-evil',\n    });\n  });\n});\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb1f6c1c4%2Fjest-mongoose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb1f6c1c4%2Fjest-mongoose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb1f6c1c4%2Fjest-mongoose/lists"}