{"id":22897279,"url":"https://github.com/center-key/assert-deep-strict-equal","last_synced_at":"2026-03-02T21:45:52.354Z","repository":{"id":57185001,"uuid":"379550472","full_name":"center-key/assert-deep-strict-equal","owner":"center-key","description":"⚖️ Asynchronous assert fails in Mocha you can see and don't timeout (with TypeScript declarations)","archived":false,"fork":false,"pushed_at":"2025-03-01T08:37:30.000Z","size":505,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T22:06:40.703Z","etag":null,"topics":["assert","deep","done","equal","mocha","strict","timeout"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/center-key.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-23T09:33:35.000Z","updated_at":"2025-03-01T08:37:23.000Z","dependencies_parsed_at":"2024-03-26T12:49:30.016Z","dependency_job_id":"0e5967df-997d-41aa-96f2-6da973a8aefe","html_url":"https://github.com/center-key/assert-deep-strict-equal","commit_stats":{"total_commits":50,"total_committers":1,"mean_commits":50.0,"dds":0.0,"last_synced_commit":"9f5963737fa045a0e0693d63bb0075dacdcfc5a2"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/center-key%2Fassert-deep-strict-equal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/center-key%2Fassert-deep-strict-equal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/center-key%2Fassert-deep-strict-equal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/center-key%2Fassert-deep-strict-equal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/center-key","download_url":"https://codeload.github.com/center-key/assert-deep-strict-equal/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252961837,"owners_count":21832196,"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":["assert","deep","done","equal","mocha","strict","timeout"],"created_at":"2024-12-14T00:16:24.492Z","updated_at":"2026-03-02T21:45:52.344Z","avatar_url":"https://github.com/center-key.png","language":"TypeScript","readme":"# assert-deep-strict-equal\n\u003cimg src=https://centerkey.com/graphics/center-key-logo.svg align=right width=200 alt=logo\u003e\n\n_Asynchronous assert fails in Mocha that you can see and don't timeout_\n\n[![License:MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/center-key/assert-deep-strict-equal/blob/main/LICENSE.txt)\n[![npm](https://img.shields.io/npm/v/assert-deep-strict-equal.svg)](https://www.npmjs.com/package/assert-deep-strict-equal)\n[![Build](https://github.com/center-key/assert-deep-strict-equal/actions/workflows/run-spec-on-push.yaml/badge.svg)](https://github.com/center-key/assert-deep-strict-equal/actions/workflows/run-spec-on-push.yaml)\n\nThe **assertDeepStrictEqual()** function checks that two values or serializable objects are identical.\u0026nbsp;\nThe optional callback supports asynchronous specification suites and doesn't timeout on assertion failures.\n\n## A) Setup\nInstall package for node:\n```shell\n$ npm install --save-dev assert-deep-strict-equal\n```\nImport into your Mocha spec file:\n```javascript\nimport { assertDeepStrictEqual } from 'assert-deep-strict-equal';\n```\n\n## B) Usage\n```javascript\nconst actual =   { ingredient: 'sugar', units: 'grams', amount: 100 };\nconst expected = { ingredient: 'sugar', units: 'grams', amount: 100 };\nassertDeepStrictEqual(actual, expected, done);\n```\nThe third parameter for the `done` callback is optional:\n```javascript\nassertDeepStrictEqual(actual, expected);  //synchronous test case\n```\n\n## C) Example\n```javascript\ndescribe('Star Wars API result for spaceship #3', () =\u003e {\n\n   it('is a Star Destroyer', (done) =\u003e {\n      const url = 'https://swapi.py4e.com/api/starships/3/';\n      const handleData = (data) =\u003e {\n         const actual = {\n            name:         data.name,\n            model:        data.model,\n            manufacturer: data.manufacturer,\n            };\n         const expected = {\n            name:         'Star Destroyer',\n            model:        'Imperial I-class Star Destroyer',\n            manufacturer: 'Kuat Drive Yards',\n            };\n         assertDeepStrictEqual(actual, expected, done);\n         };\n      fetchJson.get(url, { format: 'json' }).then(handleData);\n      });\n\n   });\n```\nCommands to run the above **Star Destroyer** example and others in [examples.spec.js](examples.spec.js):\n```shell\n$ cd assert-deep-strict-equal\n$ npm install\n$ npm run examples\n```\n\u003cimg src=https://raw.githubusercontent.com/center-key/assert-deep-strict-equal/main/examples.png\nwidth=800 alt=screenshot\u003e\nNote that the assertion failure does _not_ cause a timeout and the test case error is easy to see and interpret.\u0026nbsp;\nThe value of the `name` field is `\"BOGUS!\"` (red), but it was expected to be `\"payapa-berry\"` (green).\n\n\u003cbr\u003e\n\n---\n[MIT License](LICENSE.txt)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenter-key%2Fassert-deep-strict-equal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcenter-key%2Fassert-deep-strict-equal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcenter-key%2Fassert-deep-strict-equal/lists"}