Meteor Velocity Mirror does not have data

325 views Asked by At

I'm new to Velocity and am using Mocha as my testing framework. I understand how to writ e the tests and structure, but my mirrored app on port 5000 does not seem to have a replicant of my database. I was wondering is there extra configuration I have to do to get that wired up? All my tests fail, but thats because it has no data to compare off of.

Thank you for the help in advance, and if you need more information then I'm more than happy to provide it.

1

There are 1 answers

4
Xolv.io On

The mirror intentionally has its own database so you can continue development in the main app, but also have your tests run in the background against the mirror.

What you should do before each test (or before all tests) is setup the state you require in the database. For this you can use fixtures. If you put a file called anyName-fixture.js (or coffee) under your /tests directory, Velocity will make this file accessible in the mirror. This file can then setup the data needed for your tests.

Click here for an example of a fixture.

In your test, you can easily call the fixture using a meteor method.