New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve tests feedback, linked to #104 #105
Conversation
Nice! Looks so much better now :) |
Maybe we should do a PR to ESLint adding a hook to their rule checker so any test framework could easily hook into it? |
Yeah!
Sure. By their contribution guidelines, we should first create an issue though. Not sure I see what the hook should look like though? |
By the way: Found this comment eslint/eslint#5040 (comment), where they talk about eventually using AVA under the hood for RuleTester. |
Created an issue in ESLint about this eslint/eslint#6227 |
Now that we know that ESLint considers this okay and |
b4fa5ce
to
e1dcfe3
Compare
Hmm, looking into the tests a bit later today (worked on my end before I reinstalled all node_modules). Stay tuned. |
Let's do it! :D |
e1dcfe3
to
342cf34
Compare
There you go :) |
:) Will do a PR for XO soon-ish. |
PS: eslint/eslint#6331, if you have comments to improve this ;) |
This is related to #104, and an attempt to improve the RuleTester's feedback. By default, it uses Mocha's
describe
andit
to create rules, but it they are not defined, it uses the functions here.I've managed to override the RuleTester test creation a bit to use AVA's
test
rather than Mocha'sit
, and here are the results:Before
When run with Mocha
When run with AVA (with
--verbose
)When run with AVA and
tap-mocha-reporter
The 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 clearerPlease 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 withnpm link
), which contains the same code that you can see intest/helpers/ava-rule-tester.js
(I kept it ll so that you guys could easily see what I did here).Let me know what you guys think.
PS: 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.