{"id":22800011,"url":"https://github.com/dadi/test-tools","last_synced_at":"2025-03-30T19:17:42.179Z","repository":{"id":151392733,"uuid":"193886501","full_name":"dadi/test-tools","owner":"dadi","description":null,"archived":false,"fork":false,"pushed_at":"2019-06-26T14:20:18.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-05T21:53:43.201Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/dadi.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":"2019-06-26T10:52:50.000Z","updated_at":"2019-06-26T14:20:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"c65821e2-6e44-4c69-8419-0f056d91f7f0","html_url":"https://github.com/dadi/test-tools","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/dadi%2Ftest-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadi%2Ftest-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadi%2Ftest-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dadi%2Ftest-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dadi","download_url":"https://codeload.github.com/dadi/test-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246365644,"owners_count":20765549,"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":[],"created_at":"2024-12-12T07:10:47.627Z","updated_at":"2025-03-30T19:17:41.309Z","avatar_url":"https://github.com/dadi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Test tools\n\n## API data script\n\nTests a snapshot of database operations against an API data connector, using Mocha.\n\n### Usage\n\n```js\nconst { apiDataScript } = require('@dadi/test-tools')\nconst MyDataConnector = require('/path/to/your/data-connector')\n\ndescribe.only(\n  'Data script',\n  apiDataScript({\n    // The constructor for the data connector being tested.\n    Connector: MyDataConnector,\n\n    // The contents of the data script.\n    script: fs.readFileSync('/path/to/your/data-snapshot', 'utf8'),\n\n    // The interval (in milliseconds) between each test. Defaults to 5.\n    testDelay: 5\n  })\n)\n```\n\nTo pull the latest snapshot from the API repo, run:\n\n```\nnpm run download-api-snapshot -- /target/directory\n```\n\nThis will download `data.apisnapshot` and save it on `/target/directory`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdadi%2Ftest-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdadi%2Ftest-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdadi%2Ftest-tools/lists"}