-
Notifications
You must be signed in to change notification settings - Fork 83
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
Use static JSON in messages crate tests #822
Comments
@bobozaur i would like to work on this issue can you help me navigate it in the project directory |
Not sure what you mean. This is about most tests in The ones about |
I would like to try this out. |
Have at it :). Let me know if you need more information. The overall goal is simple: to replace json in tests with static JSON strings (or just static strings wrapped in the As an example: let expected = json!({
"credentials~attach": content.credentials_attach,
"~thread": decorators.thread
}); Would become something like: let expected = json!({
"credentials~attach": {
"field1": "value1",
"field2": "value2",
},
"~thread": {
"field_1": "value1",
"field_2": "value2",
}
}); This way, if the inner structure of say, the |
Alright, thanks for the explanation! |
In the above example you have set |
Ah, my bad. Edited. They are supposed to be different fields, yes. |
Some corners were cut when developing the tests for the
messages
crate during its refactor in the sense that the JSON was being composed off of already tested structs or fields.It would be better to use plain text JSON to ensure that any API change won't slip by the testing suite.
The text was updated successfully, but these errors were encountered: