rethink-mock
A mocking library for unit testing rethinkdb with sinon spies and stubs.
Install
npm install --save-dev rethink-mock
Use
Example
// example using mocha, chai, sinon-chai and proxyquireconst rethinkmock = const proxyquire = const chai = const expect = chaiexpectchai
Options
db: true
By default, .db
is missing from the r
object. This
is because the database is usually selected in the connection
and any .db
found in the code is probably left over from
using the Data Explorer.
If you want to use .db
, call .mock({db: true})