Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up separate test and development database in meteor

I've written a few tests for my meteor app. As they have setup and teardown methods that remove all documents or populate with new ones, I'd like to run them on a database dedicated to testing.

I notice the db is stored in .meteor/local/db . Ideally I'd like to have db_test and db_dev accessed form different ports.

Is this possible?

like image 220
Julian Mann Avatar asked Jan 04 '13 23:01

Julian Mann


1 Answers

You'll have to run two mongod processes e.g.

# Dev
mongod --port 27017 --dbpath .meteor/local/db_dev

# Testing
mongod --port 28017 --dbpath .meteor/local/db_test


[Edit] This should work. Using the leaderboard example project:
MONGO_URL="mongodb://127.0.0.1:27017/appname_dev" meteor run --port 3000
MONGO_URL="mongodb://127.0.0.1:28017/appname_test" meteor run --port 4000

That will use separate databases.

like image 132
Justin Case Avatar answered Nov 14 '22 08:11

Justin Case