-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 error message for differing output in RuleTester #8173
Comments
If you are using Jest, you could use We don't have the assertion stuff super well abstracted. |
Actually, it looks like that's a Mocha feature (docs):
So if you're overriding I suppose we could do the diff-creation within eslint, but is there a reason that other test runners don't follow mocha's behavior here? |
This issue has been raised at least 2-3 times before. Problem is, it seems to work differently for different people. As @not-an-aardvark showed, it works fine for him, but for me, I never get |
I guess it depends on which testing framework you're using. Perhaps I could change this to investigate supporting Jest? |
Closed by mistake.... Maybe @cpojer can advise us. Is I guess my question is, where should the changes happen? I'm more in favor of having Jest support the |
@kentcdodds That's the thing, I don't think it's framework related. I never use anything other then mocha, and I don't get |
@ilyavolodin What happens if you uninstall and reinstall mocha? I'm conjecturing that we haven't bumped our Mocha devDependency in years, and since you're one of the earlier contributors to ESLint, maybe I just happen to have a version of Mocha that actually displays the assert diff...? Obviously I'm reaching here. (I also noticed that our Mocha dependency is ^2.4.5 but their latest is ^3.2.0, so maybe an upgrade might fix it for you? Who knows.) |
@platinumazure You might be right. I just tested it again and noticed that I am now getting |
I'm going to close this in favor of jestjs/jest#3173 Thanks friends! |
This has been merged so the next version of Jest will support the assert module with much better messaging. This is fantastic 🎉 |
@kentcdodds Thanks for the update! Great job on that PR :) |
Right now the assertion looks like this
Which results in not very helpful output in test runs:
It would be much more helpful if the output were more like:
This is similar to what Jest's output is. And perhaps @cpojer can give us a little direction on how to make that kind of output using one of Jest's modules.
I'm happy to contribute this fix. I expect it to be relatively low-risk + high-impact
The text was updated successfully, but these errors were encountered: