{"id":23369785,"url":"https://github.com/wikimedia/mw-node-qunit","last_synced_at":"2025-06-21T20:04:26.432Z","repository":{"id":45329013,"uuid":"139071091","full_name":"wikimedia/mw-node-qunit","owner":"wikimedia","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-25T21:03:21.000Z","size":380,"stargazers_count":4,"open_issues_count":0,"forks_count":5,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-06-20T09:14:11.721Z","etag":null,"topics":["mediawiki","qunit","test-runner"],"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/wikimedia.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"zenodo":null}},"created_at":"2018-06-28T21:43:21.000Z","updated_at":"2025-04-04T04:51:15.000Z","dependencies_parsed_at":"2024-04-01T22:30:44.627Z","dependency_job_id":"e42e0707-c73e-493f-8d2e-fb587b95372a","html_url":"https://github.com/wikimedia/mw-node-qunit","commit_stats":null,"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/wikimedia/mw-node-qunit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wikimedia%2Fmw-node-qunit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wikimedia%2Fmw-node-qunit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wikimedia%2Fmw-node-qunit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wikimedia%2Fmw-node-qunit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wikimedia","download_url":"https://codeload.github.com/wikimedia/mw-node-qunit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wikimedia%2Fmw-node-qunit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261186367,"owners_count":23121938,"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":["mediawiki","qunit","test-runner"],"created_at":"2024-12-21T15:14:36.691Z","updated_at":"2025-06-21T20:04:21.419Z","avatar_url":"https://github.com/wikimedia.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mw-node-qunit\n\nA QUnit test runner for node, that adds some mediawiki specific things.\n\n```\nnpm install -g mw-node-qunit\nmw-node-qunit tests/*.js\n# Or for cross-shell and OS glob support\nmw-node-qunit 'tests/**/*.js'\n```\n\nThe output for the tests is in [TAP](https://testanything.org/) format, which\nis pretty basic, if you want pretty output, here is a [list of\nreporters](https://github.com/sindresorhus/awesome-tap#reporters) you can\ninstall to prettify output. Example:\n\n```\nnpm install -g tap-dot\nmw-node-qunit tests/*.js | tap-dot\n```\n\nIf you want to run tests on watch, use `nodemon` for example:\n\n```\nnpm install -g nodemon\nnodemon -w src -w tests --exec \"mw-node-qunit tests/*.js | tap-dot\"\n```\n\n## Testing with QUnit\n\nThis test runner will add QUnit, mediaWiki globals, and a jsdom window object\nand jquery initialized as `window`, `document`, and `jQuery` in the global\nscope so you can run your tests assuming those will be present.\n\nIt also adds a sinon sandbox to the `this` scope on a test as `this.sandbox`\nthat is automatically created and restored before and after every test, so you\ncan spy/stub things in `beforeEach` or in the tests without worrying about\nhaving to manually restoring them after the test.\n\n# Usage\n\n## without ES6 support\n\n```\nmw-node-qunit --require @babel/register \\\"tests/node-qunit/**/*.test.js\\\"\n```\n\nNote, that this is innterchangeable with:\n```\nqunit --require @babel/register \\\"tests/node-qunit/**/*.test.js\\\"\n```\nThe mw-node-qunit provides scaffolding that is useful for providing mock mediaWiki environments which can depend on existence of the jQuery, mediaWiki and DOM libraries.\n\n## with ES6+ support\n\nAvailable using Babel dependencies:\n```\n    \"@babel/core\": \"7.2.2\",\n    \"@babel/preset-env\": \"7.3.1\",\n    \"@babel/register\": \"7.0.0\",\n    \"babel-loader\": \"8.0.5\",\n```\nYou can do:\n```\nmw-node-qunit --require @babel/register \\\"tests/node-qunit/**/*.test.js\\\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwikimedia%2Fmw-node-qunit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwikimedia%2Fmw-node-qunit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwikimedia%2Fmw-node-qunit/lists"}