Mockgoose helps with testing Mongoose applications by spinning up a mock in-memory database.
Questions tagged [mockgoose]
18 questions
0
votes
1 answer
Mocha before function - lambda without curly braces errors; lambda with curly braces works
This code makes my mocha tests pass without error:
before(done => {
mockgoose
.prepareStorage()
.then(() => mongoose.connect('mongodb://example.com/TestingDB'))
.then(done)
})
it('passes', done => done())
But removing the curly…

jmrah
- 5,715
- 3
- 30
- 37
0
votes
0 answers
Initially insert documents into DB
I want to test an express app with mongoose. Therefor I am using AVA and Mockgoose.
Using the beforeEach hook of AVA I want to insert two documents into my database which I can then use in my tests.
The code looks like follows:
import test from…

user2030592
- 317
- 2
- 12
-3
votes
1 answer
Unhandled Promise Rejections 17
i am writing test cases using mocha , mockgoose and chai. while running test cases i will get unhandle Promise Rejections 17 error.
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 17): Mongod shutting down
Unhandle…

Shaggy
- 1
- 3