{"id":23089079,"url":"https://github.com/chinchiheather/chai-spies-augment","last_synced_at":"2025-08-16T07:32:01.875Z","repository":{"id":57196601,"uuid":"123758350","full_name":"chinchiheather/chai-spies-augment","owner":"chinchiheather","description":"Additions to the chai-spies library, adds ability to inspect the parameters a spy has been called with and ability to check if a spy was called with a partial object","archived":false,"fork":false,"pushed_at":"2018-03-18T07:07:47.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-26T14:05:00.095Z","etag":null,"topics":["chai","chai-spies","javascript","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chinchiheather.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}},"created_at":"2018-03-04T04:58:55.000Z","updated_at":"2022-04-27T16:14:16.000Z","dependencies_parsed_at":"2022-09-15T15:40:28.737Z","dependency_job_id":null,"html_url":"https://github.com/chinchiheather/chai-spies-augment","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/chinchiheather%2Fchai-spies-augment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinchiheather%2Fchai-spies-augment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinchiheather%2Fchai-spies-augment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chinchiheather%2Fchai-spies-augment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chinchiheather","download_url":"https://codeload.github.com/chinchiheather/chai-spies-augment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230020072,"owners_count":18160649,"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":["chai","chai-spies","javascript","unit-testing"],"created_at":"2024-12-16T20:20:13.832Z","updated_at":"2024-12-16T20:20:15.454Z","avatar_url":"https://github.com/chinchiheather.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chai-spies-augment\nAdditions to the [chai-spies](https://github.com/chaijs/chai-spies) library\n\nAdds:\n * Ability to easily inspect the parameters a spy has been called with\n * Ability to check if a spy was called with a partial object\n\n## Install\n```bash\nnpm install --save-dev chai-spies-augment\n```\n\nThen in your test setup file where you are loading chai spies\n```js\nimport chaiSpies from 'chai-spies';\nimport chaiSpiesAugment from 'chai-spies-augment';\n...\nchai.use(chaiSpies);\nchai.use(chaiSpiesAugment);\n```\n\n## Usage\n### Accessing spy call parameters\n```js\nconst spy = chai.spy();\n \nspy(1, 2, 3);\nspy('a', 'b', 'c');\n \nconst args = spy.args(); // ['a', 'b', 'c']\nconst argsFor = spy.argsFor(0); // [1, 2, 3] \n```\n### Checking for partial object\n\n```js\nconst spy = chai.spy();\n \nspy({ a: 'b', c: 'd' });\nspy(1, 'a', { b: 'c' });\n \nexpect(spy).to.have.been.called.with.objectContaining({ a: 'b' }); // true\nexpect(spy).to.have.been.called.with.objectContaining({ b: 'c' }); // true\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinchiheather%2Fchai-spies-augment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchinchiheather%2Fchai-spies-augment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchinchiheather%2Fchai-spies-augment/lists"}