Skip to content
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

Refactor tests to avoid assumptions about serialization implementation #252

Open
jacobq opened this issue Nov 25, 2019 · 0 comments
Open

Comments

@jacobq
Copy link
Contributor

jacobq commented Nov 25, 2019

It wasn't clear to me where the ${modelName}_2 portion of the docId was coming from (this shows up a bunch of places in the test suite, and I was also noticing it in my app). It seems to be from relational-pouch's serialize. If that's the case, doesn't making assumptions about the implementation details of that function make the tests somewhat brittle? (i.e. ember-pouch shouldn't have to care how relational-pouch serializes things)

Perhaps ember-pouch could/should use rel.makeDocID to generate these strings instead?

Admittedly, I haven't done much with PouchDB or relational-pouch before, but it seems to me like this addon accidentally makes use of knowledge of the inner workings of relational-pouch (not just its public API). Are there cases where the API presented by relational-pouch (find, del, save, ...) isn't sufficient and thus we need to directly use PouchDB's API (get, put, bulkDocs, ...)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant