{"action":"created","issue":{"url":"https://api.github.com/repos/sindresorhus/eslint-plugin-ava/issues/105","repository_url":"https://api.github.com/repos/sindresorhus/eslint-plugin-ava","labels_url":"https://api.github.com/repos/sindresorhus/eslint-plugin-ava/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/sindresorhus/eslint-plugin-ava/issues/105/comments","events_url":"https://api.github.com/repos/sindresorhus/eslint-plugin-ava/issues/105/events","html_url":"https://github.com/sindresorhus/eslint-plugin-ava/pull/105","id":154355541,"number":105,"title":"Improve tests feedback, linked to #104","user":{"login":"jfmengels","id":3869412,"avatar_url":"https://avatars.githubusercontent.com/u/3869412?v=3","gravatar_id":"","url":"https://api.github.com/users/jfmengels","html_url":"https://github.com/jfmengels","followers_url":"https://api.github.com/users/jfmengels/followers","following_url":"https://api.github.com/users/jfmengels/following{/other_user}","gists_url":"https://api.github.com/users/jfmengels/gists{/gist_id}","starred_url":"https://api.github.com/users/jfmengels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfmengels/subscriptions","organizations_url":"https://api.github.com/users/jfmengels/orgs","repos_url":"https://api.github.com/users/jfmengels/repos","events_url":"https://api.github.com/users/jfmengels/events{/privacy}","received_events_url":"https://api.github.com/users/jfmengels/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-11T22:16:45Z","updated_at":"2016-05-12T19:36:25Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sindresorhus/eslint-plugin-ava/pulls/105","html_url":"https://github.com/sindresorhus/eslint-plugin-ava/pull/105","diff_url":"https://github.com/sindresorhus/eslint-plugin-ava/pull/105.diff","patch_url":"https://github.com/sindresorhus/eslint-plugin-ava/pull/105.patch"},"body":"This is related to #104, and an attempt to improve the RuleTester's feedback. By default, it uses Mocha's `describe` and `it` to create rules, but it they are not defined, it uses the functions [here](https://github.com/eslint/eslint/blob/master/lib%2Ftesters%2Frule-tester.js#L436-L452).\r\n\r\nI've managed to override the RuleTester test creation a bit to use AVA's `test` rather than Mocha's `it`, and here are the results:\r\n\r\n### When run with Mocha\r\n![image](https://cloud.githubusercontent.com/assets/3869412/15198051/3dfd87ae-17d5-11e6-8e56-bd1d6a3e63b4.png)\r\n\r\n### When run with AVA (with `--verbose`)\r\n![image](https://cloud.githubusercontent.com/assets/3869412/15197939/9c7333e8-17d4-11e6-8144-e3ed61f842a6.png)\r\n\r\n### When run with AVA and `tap-mocha-reporter`\r\n\r\n![image](https://cloud.githubusercontent.com/assets/3869412/15198186/1c4689ca-17d6-11e6-89f8-e9f95b64b2af.png)\r\n\r\nThe odd `test.xxx(t => {})` kind of everywhere are the second part of the title (since it takes as title the code, and the code has a `\\n` in the middle). If we remove the `\\n`, it gets much clearer\r\n![image](https://cloud.githubusercontent.com/assets/3869412/15198224/5bbb3966-17d6-11e6-94fc-9378ff6ac3af.png)\r\n\r\nPlease check out `eslint-ava-rule-tester`, which exports a modified RuleTester. I'm up for modifying the name, but it's already published (could not make it all work with `npm link`), which contains the same code that you can see in `test/helpers/ava-rule-tester.js` (I kept it ll so that you guys could easily see what I did here).\r\n\r\nLet me know what you guys think.\r\n\r\nPS: Obviously this is just a draft, I haven't migrated all the tests and have even left an error so that you can see the error feedback more easily."},"comment":{"url":"https://api.github.com/repos/sindresorhus/eslint-plugin-ava/issues/comments/218862781","html_url":"https://github.com/sindresorhus/eslint-plugin-ava/pull/105#issuecomment-218862781","issue_url":"https://api.github.com/repos/sindresorhus/eslint-plugin-ava/issues/105","id":218862781,"user":{"login":"sindresorhus","id":170270,"avatar_url":"https://avatars.githubusercontent.com/u/170270?v=3","gravatar_id":"","url":"https://api.github.com/users/sindresorhus","html_url":"https://github.com/sindresorhus","followers_url":"https://api.github.com/users/sindresorhus/followers","following_url":"https://api.github.com/users/sindresorhus/following{/other_user}","gists_url":"https://api.github.com/users/sindresorhus/gists{/gist_id}","starred_url":"https://api.github.com/users/sindresorhus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sindresorhus/subscriptions","organizations_url":"https://api.github.com/users/sindresorhus/orgs","repos_url":"https://api.github.com/users/sindresorhus/repos","events_url":"https://api.github.com/users/sindresorhus/events{/privacy}","received_events_url":"https://api.github.com/users/sindresorhus/received_events","type":"User","site_admin":false},"created_at":"2016-05-12T19:36:25Z","updated_at":"2016-05-12T19:36:25Z","body":"Maybe we should do a PR to ESLint adding a hook to their rule checker so any test framework could easily hook into it?"}}