Closed nohorbee closed 1 year ago
Hi, thanks for the interest in this plugin and sorry for taking that long to answer :) Regarding the plugin documentation, currently the only thing to refer to is the README file here and potentially the source code itself. An addition to this can be a mongodb node driver documentation: https://www.mongodb.com/docs/drivers/node/current/usage-examples/ This is what's used under the hood of this plugin.
Regarding then/should and expects, this is relative to cypress and how you want to assert the results, expect
is one way to do it. This plugin aims to give you the result of your query as an object or array (depending on the invoked function), and what you want to do with the results afterwards is entirely up to you (further queries, assertions, etc...).
Feel more than free to improve the README any time, would be appreciated :)
Hi! I'm working on a cypress & typescript project. I have installed
cypress-mongodb
and it's great. However, I struggled to find references on how to do things properly (examples of good practices).For instance, I ended up doing something like this:
Do you think this approach is correct? Is there any better option than typing
result
asany
? Do you know if I am supposed to use then/should and that list of expects inside?I got that working after hours of searching, not founding documentation, and trial and error.
P.S.: I'd love to start writing some docs once I have a clear idea of what I'm doing.