Comments (9)
👍 +1
from goconvey.
@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.
Right, I think just a couple like ShouldResemble and ShouldBeEqual and a few others merit a change.
from goconvey.
Okie, done.
from goconvey.
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):
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):
from goconvey.
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.
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.
If the JSON had fields especially for what was Expected and Actual (when applicable), that would eliminate the need for parsing.
from goconvey.
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)
- Rendering causes endless memory allocations on proto messages HOT 3
- go test pass but browser test fails
- map[int64]bool ShouldContainKey didn't work as expected HOT 1
- ShouldResemble for proto messages HOT 1
- ShouldResemble failing for identical values in GitHub action HOT 2
- convey.So bug report: errors.New() compares with nil return wrong result
- No detailed log output after run go test HOT 4
- SoMsg didn't print out msg in test report HOT 1
- CVE-2022-24785: Moment.js Path Traversal < 2.29.2
- Cannot find goconvey in $GOPATH/bin/ HOT 2
- Coverage reports fail w/ go1.20 HOT 3
- Inconsistent test coverage between command line and web ui HOT 1
- Update smarty/assertions to fix function comparison error
- goconvey benchmark
- can i get case name in Convey HOT 1
- error running go get -u because module declares its path as `github.com/smarty/assertions`
- couldn't handle this stray line: verbose: print additional output, v1.8.1 HOT 2
- Does `goconvey` support executing `goconvey` without inline? HOT 2
- XSS Vulnerability
- Why is there no output test name on the terminal HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from goconvey.