Mongodb-memory-server: project tests are failing

Created on 24 Jun 2018  路  3Comments  路  Source: nodkz/mongodb-memory-server

@nodkz I was tryign to use your memory-server in my own project. Awesome idea. But I am running into a problem that may have something to do with your project tests you have set up. I attaching npm's log plus a copy of my own run log. Looks like maybe something needs an update. It is failing for a .toMatch method.
2018-06-24T20_08_22_039Z-debug.log
npmRunTest_consoleSnapshot.txt

I my own project, I chose to not use the es6 'import' and just stick with the older 'require' in my conn.js file within test folder. But that should not be causing any problems, should it? node is complaining of my constructor MongodbMemoryServer statement is not a constructor.
conn.txt

Most helpful comment

It maybe need more time for dowloading binaries. Please try to increase jasmine.DEFAULT_TIMEOUT_INTERVAL = 300000;.

With your tests try to make such import:

const MongodbMemoryServer = require('mongodb-memory-server').default;

All 3 comments

It maybe need more time for dowloading binaries. Please try to increase jasmine.DEFAULT_TIMEOUT_INTERVAL = 300000;.

With your tests try to make such import:

const MongodbMemoryServer = require('mongodb-memory-server').default;

@nodkz Closes #64.

your suggestion of adding ".default" fixed issue. verified by returning mocha's timeout back to 60000. Remove the .default from the require statement and the fault reappears.

I also had to comment out my MongodbMemServer instance init for dbPath. System kept saying that it could not find my relative path. I was setting a relative path that started reference from my db conn script file. When I got your server to work in my project, I noticed that dbPath was a full qualified drive/path into local AppData.

Here is my final solution for this: checkout feature/saa

Your awesome!
tony

@nodkz Including this information in the documentation will be really helpful since not everyone is using import statements. I had to dig up this issue to figure out why my tests wont even run.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexandrulesi picture alexandrulesi  路  8Comments

elreeda picture elreeda  路  3Comments

hasezoey picture hasezoey  路  4Comments

yavorski picture yavorski  路  6Comments

kbychkov picture kbychkov  路  3Comments