{"id":14967491,"url":"https://github.com/unboundedsystems/mocha-slow-options","last_synced_at":"2025-07-23T13:33:45.316Z","repository":{"id":34220842,"uuid":"171977830","full_name":"unboundedsystems/mocha-slow-options","owner":"unboundedsystems","description":"Adds better configurability to your favorite Mocha reporter to control which tests show up with times in red, yellow, or print no time at all.","archived":false,"fork":false,"pushed_at":"2025-06-18T02:44:03.000Z","size":39,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-23T00:06:35.965Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/unboundedsystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2019-02-22T02:08:42.000Z","updated_at":"2023-03-04T15:42:01.000Z","dependencies_parsed_at":"2024-02-08T18:30:46.415Z","dependency_job_id":"46de6613-08c0-488e-aad0-07dffc8bb4af","html_url":"https://github.com/unboundedsystems/mocha-slow-options","commit_stats":{"total_commits":16,"total_committers":4,"mean_commits":4.0,"dds":0.5625,"last_synced_commit":"e8bc9e375b1659088bdff39019c05ffdd91d55fa"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/unboundedsystems/mocha-slow-options","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unboundedsystems%2Fmocha-slow-options","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unboundedsystems%2Fmocha-slow-options/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unboundedsystems%2Fmocha-slow-options/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unboundedsystems%2Fmocha-slow-options/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unboundedsystems","download_url":"https://codeload.github.com/unboundedsystems/mocha-slow-options/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unboundedsystems%2Fmocha-slow-options/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266689222,"owners_count":23969140,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-09-24T13:38:08.133Z","updated_at":"2025-07-23T13:33:45.283Z","avatar_url":"https://github.com/unboundedsystems.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mocha-slow-options\n\nAdds better configurability to your favorite mocha reporter to control\nwhich tests show up with times in red, yellow, or print no time at all.\n\n## Usage\n### Example\n```\n  mocha --slow 100 --reporter mocha-slow-options --reporter-options useReporter=spec,mediumPercent=75 \n```\nThis runs mocha with the default slow value set to 100ms, uses the `spec`\nreporter, and sets the additional config option `mediumPercent` to 0.75.\nNow, tests that take less than 75ms (100ms * .75) will print no time, tests\nthat take between 75 and 100ms will print time in yellow, and tests over 100ms\nwill print time in red.\n\n### Installation\n```\nnpm install --save-dev mocha-slow-options\n```\n\n### Basic usage\nOnce you've installed mocha-slow-options, you use it with the `--reporter`\ncommand line option:\n```\nmocha --reporter mocha-slow-options \u003cother mocha options\u003e\n```\n\n### Options\nAll options for mocha-slow-options are set on the command line using mocha's\n`--reporter-options` flag. You can specify multiple options, separating them\nwith a comma. See above for an example and [check out mocha's Usage section\nfor more info](https://mochajs.org/#usage).\n\n* `useReporter`: The name of a mocha built-in reporter to use. Default: `spec`\n* `mediumPercent`: A percentage from 0 to 100, to be applied to each\ntest's slow value. Tests that run longer than\n`mediumPercent / 100 * \u003cslow value\u003e` will be marked as speed=medium,\nwhich typically prints in yellow. Default: 80.\n\n## Why?\nMocha [gives you some feedback](https://mochajs.org/#test-duration)\non tests that are taking a long time to run. It marks each passing test with\na speed:\n\n* `slow`: Reporters typically show the test duration in red.\n* `medium`: Reporters typically show the test duration in yellow.\n* `fast`: Reporters typically do not show the test duration.\n\nThe `slow` setting is configurable using the `--slow` command line option or\nusing `this.slow(value)` in your code. And the threshold between `medium` and\n`fast` is computed like this:\n```\nmediumPercent / 100 * \u003cslow value\u003e\n```\nHowever, mocha's built-in reporters don't allow you to configure `mediumPercent`.\nFor all of them, it's hard-coded to 50.\n\nmocha-slow-options adds the ability to adjust the `mediumPercent` value, while\nstill using mocha's built-in reporters.\n\n## How?\nmocha-slow-options inserts itself between mocha and your chosen `useReporter`,\nlistening on mocha's test \"pass\" event, in order to compute which tests are\nclassified as slow, medium, or fast.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funboundedsystems%2Fmocha-slow-options","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funboundedsystems%2Fmocha-slow-options","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funboundedsystems%2Fmocha-slow-options/lists"}