{"action":"created","issue":{"url":"https://api.github.com/repos/mochajs/mocha/issues/1512","labels_url":"https://api.github.com/repos/mochajs/mocha/issues/1512/labels{/name}","comments_url":"https://api.github.com/repos/mochajs/mocha/issues/1512/comments","events_url":"https://api.github.com/repos/mochajs/mocha/issues/1512/events","html_url":"https://github.com/mochajs/mocha/pull/1512","id":55247923,"number":1512,"title":"Add randomization support","user":{"login":"TimothyGu","id":1538624,"avatar_url":"https://avatars.githubusercontent.com/u/1538624?v=3","gravatar_id":"","url":"https://api.github.com/users/TimothyGu","html_url":"https://github.com/TimothyGu","followers_url":"https://api.github.com/users/TimothyGu/followers","following_url":"https://api.github.com/users/TimothyGu/following{/other_user}","gists_url":"https://api.github.com/users/TimothyGu/gists{/gist_id}","starred_url":"https://api.github.com/users/TimothyGu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimothyGu/subscriptions","organizations_url":"https://api.github.com/users/TimothyGu/orgs","repos_url":"https://api.github.com/users/TimothyGu/repos","events_url":"https://api.github.com/users/TimothyGu/events{/privacy}","received_events_url":"https://api.github.com/users/TimothyGu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":28,"created_at":"2015-01-23T05:58:36Z","updated_at":"2015-02-14T19:12:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mochajs/mocha/pulls/1512","html_url":"https://github.com/mochajs/mocha/pull/1512","diff_url":"https://github.com/mochajs/mocha/pull/1512.diff","patch_url":"https://github.com/mochajs/mocha/pull/1512.patch"},"body":"## Big Fat Warning\r\n\r\nThis is a **WIP**. I just wanted to throw the idea out there and see if there's any feedback before I start writing tests and docs.\r\n\r\n## How to use it?\r\n\r\nThe array shuffling is done with the [knuth-shuffle-seeded](https://www.npmjs.com/package/knuth-shuffle-seeded), my fork of [knuth-shuffle](https://www.npmjs.com/package/knuth-shuffle) that supports seeding.\r\n\r\n```\r\nmocha --randomization tests\r\nmocha -a tests\r\nmocha -a tests:mySeed123ee456eeed\r\n```\r\n\r\n```js\r\n{\r\n  randomizeMode: 'test'\r\n, randomizeSeed: 'mySeed'\r\n}\r\n```\r\n\r\nIf your test needs to be tested in a particular order, add `noRandom`:\r\n\r\n```js\r\ndescribe.noRandom('my test', function () {\r\n  [...]\r\n})\r\n```\r\n\r\n`noRandom` plays nicely with other modifiers (although I admit the implementation is a little ugly):\r\n\r\n```js\r\ndescribe.noRandom.only()\r\ndescribe.only.noRandom()\r\ndescribe.noRandom.skip()\r\ndescribe.skip.noRandom()\r\nxdescribe.noRandom()\r\n```\r\n\r\n## Current state\r\n\r\nCurrently it only supports test-level randomization (`mode === 'tests'`), which means that only the order of tests within a suite is randomized.\r\n\r\n## TODO\r\n\r\n- tests\r\n- docs\r\n- suite-level randomization (might be added after this PR)\r\n\r\nFixes #902."},"comment":{"url":"https://api.github.com/repos/mochajs/mocha/issues/comments/74387938","html_url":"https://github.com/mochajs/mocha/pull/1512#issuecomment-74387938","issue_url":"https://api.github.com/repos/mochajs/mocha/issues/1512","id":74387938,"user":{"login":"dasilvacontin","id":1260830,"avatar_url":"https://avatars.githubusercontent.com/u/1260830?v=3","gravatar_id":"","url":"https://api.github.com/users/dasilvacontin","html_url":"https://github.com/dasilvacontin","followers_url":"https://api.github.com/users/dasilvacontin/followers","following_url":"https://api.github.com/users/dasilvacontin/following{/other_user}","gists_url":"https://api.github.com/users/dasilvacontin/gists{/gist_id}","starred_url":"https://api.github.com/users/dasilvacontin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dasilvacontin/subscriptions","organizations_url":"https://api.github.com/users/dasilvacontin/orgs","repos_url":"https://api.github.com/users/dasilvacontin/repos","events_url":"https://api.github.com/users/dasilvacontin/events{/privacy}","received_events_url":"https://api.github.com/users/dasilvacontin/received_events","type":"User","site_admin":false},"created_at":"2015-02-14T19:12:00Z","updated_at":"2015-02-14T19:12:00Z","body":"Also, are suites inheriting `._enableRandomize`?"}}