{"id":15015833,"url":"https://github.com/mainmatter/qunit-dom","last_synced_at":"2025-05-14T12:07:04.046Z","repository":{"id":24566014,"uuid":"101902241","full_name":"mainmatter/qunit-dom","owner":"mainmatter","description":"High Level DOM Assertions for QUnit","archived":false,"fork":false,"pushed_at":"2025-04-03T19:13:25.000Z","size":14773,"stargazers_count":179,"open_issues_count":52,"forks_count":125,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-03T22:04:37.008Z","etag":null,"topics":["dom-assertions","ember","emberjs","hacktoberfest","qunit","qunit-dom"],"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/mainmatter.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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":"2017-08-30T16:05:54.000Z","updated_at":"2025-01-28T11:41:40.000Z","dependencies_parsed_at":"2023-02-19T04:31:20.634Z","dependency_job_id":"d9afbbf0-ccd3-49d1-b0dd-e5040fbebd1a","html_url":"https://github.com/mainmatter/qunit-dom","commit_stats":{"total_commits":2173,"total_committers":66,"mean_commits":32.92424242424242,"dds":0.5186378278877128,"last_synced_commit":"d55e6cbbeba73b3aff98bf1abb84e75c6be8687e"},"previous_names":["simplabs/qunit-dom"],"tags_count":48,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mainmatter%2Fqunit-dom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mainmatter%2Fqunit-dom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mainmatter%2Fqunit-dom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mainmatter%2Fqunit-dom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mainmatter","download_url":"https://codeload.github.com/mainmatter/qunit-dom/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248298350,"owners_count":21080319,"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":["dom-assertions","ember","emberjs","hacktoberfest","qunit","qunit-dom"],"created_at":"2024-09-24T19:48:01.442Z","updated_at":"2025-04-11T04:24:18.141Z","avatar_url":"https://github.com/mainmatter.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"qunit-dom\n==============================================================================\n\n[![CI Build Status](https://github.com/simplabs/qunit-dom/actions/workflows/ci.yml/badge.svg)](https://github.com/simplabs/qunit-dom/actions/workflows/ci.yml)\n[![Latest NPM release][npm-badge]][npm-badge-url]\n\n[npm-badge]: https://img.shields.io/npm/v/qunit-dom.svg\n[npm-badge-url]: https://www.npmjs.com/package/qunit-dom\n[travis-badge]: https://img.shields.io/travis/simplabs/qunit-dom/master.svg\n[travis-badge-url]: https://travis-ci.org/simplabs/qunit-dom\n\nHigh Level DOM Assertions for [QUnit](https://qunitjs.com/)\n\n```js\nassert.dom('h1').exists();\nassert.dom('h1').hasClass('title');\nassert.dom('h1').hasText('Welcome to Ember, John Doe!');\n\nassert.dom('input').isFocused();\nassert.dom('input').hasValue(/.+ Doe/);\nassert.dom('input').hasAttribute('type', 'text');\n```\n\n\u003e [!NOTE]\n\u003e qunit-dom was written and is maintained by [Mainmatter](https://mainmatter.com) and contributors.\n\u003e We offer consulting, training, and team augmentation for web development teams – check out our [website](https://mainmatter.com/) to learn more!\n\nInstall\n------------------------------------------------------------------------------\n\n### npm\n\n```bash\nnpm install --save-dev qunit-dom\n```\n\nor using [`yarn`](https://yarnpkg.com/):\n\n```bash\nyarn add --dev qunit-dom\n```\n\n### Ember projects using `ember-qunit` v6.x and above\n\nImport and run the `setup` function in your `test-helper.js` file:\n\n```js\n// tests/test-helper.js\nimport * as QUnit from 'qunit';\nimport { setup } from 'qunit-dom';\n\n//...\n\nsetup(QUnit.assert);\n\nsetApplication(Application.create(config.APP));\n\nstart();\n\n//...\n```\n\nThis will attach the APIs to QUnit's `assert` object.\n\n### Ember projects using \u0026lt; v6.x of ember-qunit\n\nInstall qunit-dom v2.0.0\n\n### `\u003cscript\u003e` Tag\n\nLoad `qunit-dom.js` *after* `qunit.js`:\n\n```html\n\u003cscript src=\"https://unpkg.com/qunitjs/qunit/qunit.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://unpkg.com/qunit-dom/dist/qunit-dom.js\"\u003e\u003c/script\u003e\n```\n\n\nUsage\n------------------------------------------------------------------------------\n\nOnce installed the DOM element assertions are available at `assert.dom(...).*`:\n\n```js\ntest('the title is welcoming', function(assert) {\n  assert.dom('#title').hasText('Welcome to QUnit');\n});\n```\n\n**All available assertions are documented in [API.md](API.md).**\n\nA basic codemod to automatically convert your assertions is available at\n[https://github.com/simplabs/qunit-dom-codemod](https://github.com/simplabs/qunit-dom-codemod).\n\n\n### TypeScript\n\n`qunit-dom` includes type definition files, but the way it extends QUnit means\nthat you need import it somewhere so that TS and your editor can pick up the\ntypes. It is recommended to add the following line to your\n`tests/test-helper.ts` file:\n\n```\nimport 'qunit-dom';\n```\n\nRename your `tests/test-helper.js` to `.ts` if you do not have such a\nfile yet.\n\nContributing\n------------------------------------------------------------------------------\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md).\n\nRelated\n------------------------------------------------------------------------------\n\n- [chai-dom](https://github.com/nathanboktae/chai-dom) – DOM assertions for\n  the Chai assertion library using vanilla JavaScript\n- [chai-jquery](https://github.com/chaijs/chai-jquery) – jQuery assertions\n  for chai\n\n\nLicense\n------------------------------------------------------------------------------\n\nqunit-dom is developed by and \u0026copy;\n[Mainmatter GmbH](http://mainmatter.com) and contributors. It is released under the\n[MIT License](https://github.com/simplabs/qunit-dom/blob/master/LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmainmatter%2Fqunit-dom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmainmatter%2Fqunit-dom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmainmatter%2Fqunit-dom/lists"}