Open timbot1789 opened 1 year ago
This is internal work, not needed for MVP. Should be fixed sooner rather than later though.
Hey @timbot1789, I saw there's been work made in the mock directory for the project. Would that be related to this issue or does it have something more to do with mocking the session.fetch from Inrupt?
Hey @timbot1789, I saw there's been work made in the mock directory for the project. Would that be related to this issue or does it have something more to do with mocking the session.fetch from Inrupt?
No the goal here is to mock the solid pod itself (or it's network responses) rather than inrupt's solid client module. That way the tests arent dependent on us using inrupt's libraries. Just the solid protocol.
This issue isnt very important. More a note about a better design.
Is your feature request related to a problem? Please describe. Currently, our unit tests are based around mocking Inrupt's
solid-client
library. However, this means that the unit tests have a dependency onsolid-client
. If we ever update the library, and that update includes breaking changes, our unit tests won't be able to detect them.Describe the solution you'd like A better way would be to mock responses to the network calls inrupt itself makes. Most of these are REST calls to prescribed endpoints, based on the linked data platform. Vitest suggests using Mock service worker to do this.
Additional context The main goal of this issue is to remove the test cases' dependency on any specific implementation of Inrupt's libraries. Even if we remove Inrupt's library entirely, and replace it with something else, our tests should still work.
Another goal is to give me an excuse to learn how the Linked Data Platform works.