{"id":13799689,"url":"https://github.com/cdaringe/ava-fixture-docker-db","last_synced_at":"2025-04-28T20:31:18.256Z","repository":{"id":33782405,"uuid":"161956479","full_name":"cdaringe/ava-fixture-docker-db","owner":"cdaringe","description":"acquire a fresh docker database container attached to your ava test context","archived":false,"fork":false,"pushed_at":"2024-08-03T10:36:47.000Z","size":528,"stargazers_count":4,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-22T16:02:45.662Z","etag":null,"topics":["ava","database","docker","node","postgres","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdaringe.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-12-16T00:59:16.000Z","updated_at":"2024-08-03T10:35:33.000Z","dependencies_parsed_at":"2023-02-18T03:31:15.122Z","dependency_job_id":"7a0fbad2-4977-4ce2-a0f2-07dac14ae6e3","html_url":"https://github.com/cdaringe/ava-fixture-docker-db","commit_stats":{"total_commits":244,"total_committers":4,"mean_commits":61.0,"dds":"0.10655737704918034","last_synced_commit":"77cedda97ed30ea68132cef761cd064f80b6245a"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaringe%2Fava-fixture-docker-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaringe%2Fava-fixture-docker-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaringe%2Fava-fixture-docker-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaringe%2Fava-fixture-docker-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdaringe","download_url":"https://codeload.github.com/cdaringe/ava-fixture-docker-db/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251383667,"owners_count":21580916,"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":["ava","database","docker","node","postgres","typescript"],"created_at":"2024-08-04T00:01:05.131Z","updated_at":"2025-04-28T20:31:17.935Z","avatar_url":"https://github.com/cdaringe.png","language":"TypeScript","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"# ava-fixture-docker-db\n\nacquire a fresh docker database container attached to your ava test context\n\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![Greenkeeper badge](https://badges.greenkeeper.io/cdaringe/postgraphile-upsert.svg)](https://greenkeeper.io/) [![CircleCI](https://circleci.com/gh/cdaringe/ava-fixture-docker-db.svg?style=svg)](https://circleci.com/gh/cdaringe/ava-fixture-docker-db)\n\n## usage\n\n```ts\nimport ava, { TestInterface } from 'ava'\nimport { db, DbContext } from 'ava-fixture-docker-db'\n\nconst test = ava as TestInterface\u003cDbContext\u003e\n\ntest.beforeEach(t =\u003e db.setup(t.context)) // setup(context, dbOptions, dockerodeOptions)\ntest.afterEach(t =\u003e db.teardown(t.context))\n\ntest('some that needs a db!', async t =\u003e {\n  t.is(t.context.dbConfig.username, 'postgres', 'has default postgres user')\n  const containerData = await t.context.dbContainer.inspect()\n  t.truthy(containerData.Image, 'has docker image')\n  t.is(containerData.State.Status, 'running', 'db is running')\n  t.is(Object.keys(containerData.HostConfig.PortBindings).length, 1, 'has host port exposed')\n})\n```\nsee the exported typescript typings or source for the simple additional APIs you can use in setup.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdaringe%2Fava-fixture-docker-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdaringe%2Fava-fixture-docker-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdaringe%2Fava-fixture-docker-db/lists"}