jbrumwell / mock-knex

A mock knex adapter for simulating a database during testing
MIT License
240 stars 71 forks source link

Document the complete API #63

Closed marcbachmann closed 5 years ago

marcbachmann commented 7 years ago

A tracker extends an EventEmitter class but that api is not documented. In your tests you're also using tracker.once('query', cb), so is that the official api? e.g. https://github.com/colonyamerican/mock-knex/blob/master/test/common/tracker.js#L49

I'd like to use it.

maxArturo commented 7 years ago

I think we could potentially add more examples to the README and showcase some of the usages from the tests for sure. We could also highlight that you can use all methods of EventEmitter on the tracker. However exhaustively documenting everything you can do with the tracker as EventEmitter might be outside of scope IMO.

maxArturo commented 7 years ago

Although now that I think of it I'm not sure myself if there was any purposeful intent on not documenting that @jbrumwell?

jbrumwell commented 7 years ago

I agree I don't think we need to document every usage but definitely mentioning that tracker inherits from event emitter would be beneficial. @marcbachmann yes there are no plans to move away from extending event emitter so feel free to use it :)