{"id":26953163,"url":"https://github.com/smartlyio/objection-transactional-tests","last_synced_at":"2025-04-03T01:20:00.654Z","repository":{"id":43114773,"uuid":"149611495","full_name":"smartlyio/objection-transactional-tests","owner":"smartlyio","description":"Wrap Jest or Mocha tests in Objection transactions","archived":false,"fork":false,"pushed_at":"2023-12-15T14:41:35.000Z","size":13,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":108,"default_branch":"master","last_synced_at":"2024-04-14T06:24:40.308Z","etag":null,"topics":["objection-orm","objectionjs"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartlyio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-09-20T13:12:44.000Z","updated_at":"2023-07-26T05:59:29.000Z","dependencies_parsed_at":"2023-12-15T15:52:48.291Z","dependency_job_id":null,"html_url":"https://github.com/smartlyio/objection-transactional-tests","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlyio%2Fobjection-transactional-tests","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlyio%2Fobjection-transactional-tests/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlyio%2Fobjection-transactional-tests/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartlyio%2Fobjection-transactional-tests/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartlyio","download_url":"https://codeload.github.com/smartlyio/objection-transactional-tests/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246917373,"owners_count":20854628,"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":["objection-orm","objectionjs"],"created_at":"2025-04-03T01:20:00.130Z","updated_at":"2025-04-03T01:20:00.635Z","avatar_url":"https://github.com/smartlyio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Objection transactional tests\n\nRun tests in [Jest](https://jestjs.io) or [Mocha](https://mochajs.org) in [Objection.js](http://vincit.github.io/objection.js/) transactions. This starts a new transaction at the beginning of each tests and does a rollback at the end of it, reverting the database to the state it was in before  the test.\n\n## Usage\n\n```javascript\n\nimport { transactionPerTest } from \"objection-transactional-tests\";\n\ndescribe(\"examples\", () =\u003e {\n  transactionPerTest();\n  it(\"database interactions\", () =\u003e {\n    // do something that touches database\n  });\n});\n\n```\n\nNote that any database changes done in `beforeAll` won't be cleaned up.\n\nThe setup can be added to test setup script to apply it automatically for all\ntests. This will ensure that no test pollute the test database, but also adds\noverhead to tests that do not use the database.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartlyio%2Fobjection-transactional-tests","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartlyio%2Fobjection-transactional-tests","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartlyio%2Fobjection-transactional-tests/lists"}