{"id":15590324,"url":"https://github.com/bkeepers/expect-promise","last_synced_at":"2026-06-07T14:31:25.475Z","repository":{"id":66302904,"uuid":"74895417","full_name":"bkeepers/expect-promise","owner":"bkeepers","description":"an extension to expect for testing promises","archived":false,"fork":false,"pushed_at":"2016-11-27T15:18:49.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-18T06:25:03.691Z","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/bkeepers.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":"2016-11-27T15:13:30.000Z","updated_at":"2023-02-02T14:03:41.000Z","dependencies_parsed_at":"2023-02-21T02:46:13.186Z","dependency_job_id":null,"html_url":"https://github.com/bkeepers/expect-promise","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/bkeepers%2Fexpect-promise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkeepers%2Fexpect-promise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkeepers%2Fexpect-promise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bkeepers%2Fexpect-promise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bkeepers","download_url":"https://codeload.github.com/bkeepers/expect-promise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243093993,"owners_count":20235471,"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-10-02T23:21:20.124Z","updated_at":"2025-12-16T12:53:02.214Z","avatar_url":"https://github.com/bkeepers.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# expect-promise\n\nan extension to [expect](https://github.com/mjackson/expect) for testing promises.\n\n## Installation\n\n    $ npm install --save-dev expect-promise\n\n## API\n\n- `expect(promise).toBeAPromise()`\n- `expect(promise).toHaveBeenResolved(done)`\n- `expect(promise).toHaveBeenRejected(done)`\n\n## Usage\n\n```js\nconst expect = require('expect');\nconst expectPromise = require('expect-promise');\n\nexpect.extend(expectPromise);\n\ndescribe('expect-promise', () =\u003e {\n  it('passes when promise was resolved', done =\u003e {\n    expect(Promise.resolve()).toHaveBeenResolved(done);\n  });\n\n  it('fails when resolved promise was expected to be rejected', done =\u003e {\n    expect(Promise.resolve()).toHaveBeenRejected(done);\n  });\n});\n```\n\n**Note!** Since Promises are an asynchronous feature, `toHaveBeenResolved` and `toHaveBeenRejected` expect the `done` callback that is passed as an argument to `it`. This callback will be called with an error when the promise is resolved or rejected, which will pass or fail the test for [asynchronous code in mocha](https://mochajs.org/#asynchronous-code).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkeepers%2Fexpect-promise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbkeepers%2Fexpect-promise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbkeepers%2Fexpect-promise/lists"}