Skip to content

Conversation

skarimo
Copy link
Member

@skarimo skarimo commented Feb 7, 2023

Previously we serialized the responses again so that we can compare bdd fixtures with the actual response objects. For example take a look at the failure below:

   ✖ And the response "widgets[0].definition.requests[0].style" is equal to {"palette": "warm","line_type": "solid","line_width": "normal"} # features/step_definitions/request_steps.ts:255
       AssertionError
           + expected - actual

            {
           -  "lineType": "solid"
           -  "lineWidth": "normal"
           +  "line_type": "solid"
           +  "line_width": "normal"
              "palette": "warm"
            }

To avoid the above, we used to serialized the response so that keys get remapped properly lineType -> line_type.

This PR deserializes the fixtures values instead of the serializing response again for comparing.

@skarimo skarimo requested a review from a team as a code owner February 7, 2023 20:24
@skarimo skarimo force-pushed the sherz/remove-serilizing-in-bdd branch from 09df007 to 8913c69 Compare February 8, 2023 15:48
@skarimo skarimo changed the title Remap test assertion keys to attribute name instead of serializing again Deserialize fixture values Feb 8, 2023
@skarimo skarimo merged commit 51d6c50 into master Feb 8, 2023
@skarimo skarimo deleted the sherz/remove-serilizing-in-bdd branch February 8, 2023 17:40
github-actions bot pushed a commit that referenced this pull request Feb 8, 2023
* deserialize fixture instead

* remove lodash import

* small cleanup 51d6c50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants