Closed NikolayFrantsev closed 4 years ago
@Shutnik Could you add a test for this?
It's mostly to ensure I don't break it when refactoring later 😄
@SimenB I checked /test/test.js
and seems there are no examples for testing message formats. Can you please suggest me way to write tests for current case?
@Shutnik Easiest would be to spy on app.msg
and assert it was called with the correct message.
I threw together an example in the v2 branch for you.
https://github.com/SimenB/stylint/commit/5e373b88a33279e4bf266bfd9d49ac0d124e92fa
If you wanna make the PR out to v2 instead, I would prefer that 😄 Both works, though! If you don't want to, you can spy and assert with Sinon on the master branch.
I'm currently rewriting how rules report (#356), after which tests for messages will be much cleaner.
Hey.
Current message of sortOrder check is useless, since it's hard to understand correct properties order. I updated message with useful hint to help ordering properties.