Giter Club home page Giter Club logo

Comments (9)

mholt avatar mholt commented on July 30, 2024

👍 +1

from goconvey.

mdwhatcott avatar mdwhatcott commented on July 30, 2024

@mholt Can you take a look at the messages.go file in the assertions package and tell me which groupings of messages you would change? The "Equality" and "Type checking" groupings are a given--it's easy to arrange those messages like this:

Expected: <expected_value>
Actual: <actual_value>

But I'm not sure if the others need to change and if they do, what the changes should be.

from goconvey.

mholt avatar mholt commented on July 30, 2024

Right, I think just a couple like ShouldResemble and ShouldBeEqual and a few others merit a change.

from goconvey.

mholt avatar mholt commented on July 30, 2024

Okie, done.

from goconvey.

mdwhatcott avatar mdwhatcott commented on July 30, 2024

I think I'd like to re-open this issue and modify all of the failure messages toward something more in line with mspec (which is what we've been using in the 'magical' land of .Net and was a big inspiration for goconvey):

https://github.com/machine/machine.specifications/blob/master/Source/Machine.Specifications/ExtensionMethods.cs

What do you think @mholt and @joliver?

This is what I'd like to do with ShouldEqual when comparing strings (and maybe even arrays/slices when compared with ShouldResemble):

https://github.com/machine/machine.specifications/blob/869509569dc0b3bc49311e88a9bd39494b273291/Source/Machine.Specifications/Utility/Internal/PrettyPrintingExtensions.cs

from goconvey.

mholt avatar mholt commented on July 30, 2024

Now we have to be very careful when changing output messages like this, because the web UI does some mild parsing of the expected/actual strings.

from goconvey.

mdwhatcott avatar mdwhatcott commented on July 30, 2024

Which is kind of why I wanted to make the failure messages so easy to understand as presented in console-mode that we could just show them as-is in the web UI... The JSON contract will be pretty standard, but banking on a contract within a failure string is inherently fragile.

Maybe we could think about an additional step in the web server parser that turns certain failure messages into json so that the client won't break. Or maybe there could be JSON failure strings when the json flag is provided to GoConvey. I'd really like to adopt a scheme that allows us to improve failure messages without consequence to the web UI.

from goconvey.

mholt avatar mholt commented on July 30, 2024

If the JSON had fields especially for what was Expected and Actual (when applicable), that would eliminate the need for parsing.

from goconvey.

mdwhatcott avatar mdwhatcott commented on July 30, 2024

Yes that is one of the options. Stay tuned for the redesigned failure strings. That might be the clearest way, both from the perspective of the code to get it done as well as the user experience.

from goconvey.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.