devour-js / devour-client

Don't just consume your JSON API, Devour it...
https://www.npmjs.com/package/devour-client
ISC License
429 stars 89 forks source link

add test for complex relationships #161

Closed zenchild closed 5 years ago

zenchild commented 6 years ago

Priority

Is this PR blocking your next action?

No but the fix in #154 is.

What Changed & Why

I had originally added a fix for infinite looping that was different than the one in #154 but I liked that approach better so I removed my code, merged in the fix from #154 but my test was still relevant so I added that back in.

Testing

Assuming you have my branch pulled down you can see the infinite loop bug in action by doing the following:

# Check out the files prior to the fix by @Kokogino
git checkout 015a3799~1 -- src/middleware/json-api/_deserialize.js src/middleware/json-api/res-deserialize.js
./node_modules/.bin/mocha -g 'should deserialize complex relations without going into an infinite loop'
# When finished
git checkout HEAD src/
./node_modules/.bin/mocha -g 'should deserialize complex relations without going into an infinite loop'

Bug/Ticket Tracker

Original Fix: #154

People

@Kokogino fixed the bug in #154

Auspicus commented 5 years ago

@zenchild This is just to add tests right? Do you mind re-rolling the latest master into this?

zenchild commented 5 years ago

@Auspicus Sorry for the tardiness. I went on vacation right after you sent your message. :)

Auspicus commented 5 years ago

@zenchild No worries. Thanks for the contribution 🎉

Auspicus commented 5 years ago

Released in 2.0.27 🚀