{"action":"created","issue":{"url":"https://api.github.com/repos/mochajs/mocha/issues/1923","labels_url":"https://api.github.com/repos/mochajs/mocha/issues/1923/labels{/name}","comments_url":"https://api.github.com/repos/mochajs/mocha/issues/1923/comments","events_url":"https://api.github.com/repos/mochajs/mocha/issues/1923/events","html_url":"https://github.com/mochajs/mocha/pull/1923","id":111585345,"number":1923,"title":"Bug: fix `describe.only` to work","user":{"login":"yorkie","id":1935767,"avatar_url":"https://avatars.githubusercontent.com/u/1935767?v=3","gravatar_id":"","url":"https://api.github.com/users/yorkie","html_url":"https://github.com/yorkie","followers_url":"https://api.github.com/users/yorkie/followers","following_url":"https://api.github.com/users/yorkie/following{/other_user}","gists_url":"https://api.github.com/users/yorkie/gists{/gist_id}","starred_url":"https://api.github.com/users/yorkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yorkie/subscriptions","organizations_url":"https://api.github.com/users/yorkie/orgs","repos_url":"https://api.github.com/users/yorkie/repos","events_url":"https://api.github.com/users/yorkie/events{/privacy}","received_events_url":"https://api.github.com/users/yorkie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-10-15T10:09:11Z","updated_at":"2015-11-05T16:42:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mochajs/mocha/pulls/1923","html_url":"https://github.com/mochajs/mocha/pull/1923","diff_url":"https://github.com/mochajs/mocha/pull/1923.diff","patch_url":"https://github.com/mochajs/mocha/pull/1923.patch"},"body":"The `describe.only` seems not to be working currently. After researching something codes from the repository, I learn `only` is based on the awesome option `grep`. But the set to grep from `only` describe does after `runner.run(done)`(Essentially it's `grepTotal`), but the current source code attach grep at https://github.com/yorkie/mocha/blob/b0ce87c78e84d32008dcbc93fa32fd0cd3129845/lib/mocha.js#L465, so the grep from `describe.only` doesn't apply at this case.\r\n\r\nI added a trigger `beforeSuite` and an `once` listen for doing re-grep. Now this change works for me :-)"},"comment":{"url":"https://api.github.com/repos/mochajs/mocha/issues/comments/154117037","html_url":"https://github.com/mochajs/mocha/pull/1923#issuecomment-154117037","issue_url":"https://api.github.com/repos/mochajs/mocha/issues/1923","id":154117037,"user":{"login":"travisjeffery","id":15225,"avatar_url":"https://avatars.githubusercontent.com/u/15225?v=3","gravatar_id":"","url":"https://api.github.com/users/travisjeffery","html_url":"https://github.com/travisjeffery","followers_url":"https://api.github.com/users/travisjeffery/followers","following_url":"https://api.github.com/users/travisjeffery/following{/other_user}","gists_url":"https://api.github.com/users/travisjeffery/gists{/gist_id}","starred_url":"https://api.github.com/users/travisjeffery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisjeffery/subscriptions","organizations_url":"https://api.github.com/users/travisjeffery/orgs","repos_url":"https://api.github.com/users/travisjeffery/repos","events_url":"https://api.github.com/users/travisjeffery/events{/privacy}","received_events_url":"https://api.github.com/users/travisjeffery/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T16:42:56Z","updated_at":"2015-11-05T16:42:56Z","body":"Yeah since .only uses .grep internally, so the docs could be improved there."}}