Closed legik-9i closed 4 years ago
Hello.
I try to use this package to unit test with jest. There are no any mongodb driver on my PC.
I have this code
import mongoUnit from 'mongo-unit'; describe('CRUD Contract', () => { it('create', async () => { const dbUrl = await mongoUnit.start(); console.log(dbUrl); expect(1 + 1).toBe(2); mongoUnit.stop(); }, 10000); });
Output is:
PASS src/tests/modules/contract/index.test.js CRUD Contract ✓ create (2439ms) console.log src/tests/modules/contract/index.test.js:8 undefined Test Suites: 1 passed, 1 total Tests: 1 passed, 1 total Snapshots: 0 total Time: 4.803s, estimated 6s
But, as you see, dbUrl is undefined. Why? Is it a bug from here?
I came across this and fixed it in this PR:
https://github.com/mikhail-angelov/mongo-unit/pull/33
this PR is merged v 2.0.0 so it should be fixed
Hello.
I try to use this package to unit test with jest. There are no any mongodb driver on my PC.
I have this code
Output is:
But, as you see, dbUrl is undefined. Why? Is it a bug from here?