vendredi 23 avril 2021

How do I run Ember tests using local Mongo DB?

I have set up a local Mongo Database which I initialise as follows:

(shell 1)
> mongo
mongo> use prod-db

I then start my local server:

(shell 2)
> yarn start:server

and I then start my ember app:

(shell 3)
> yarn start:my-ember-app

I now want to write some ember tests and for this I do not want to use ember-cli-mirage. I want to use the actual local server I mention above and I also want to use my local Mondo DB, just not the prod-db database but a test-db one.

In other words I want to do:

(shell 1)
> mongo
mongo > use test-db

(shell 2)
> yarn start:server

(shell 3)
> yarn run:ember-tests

However, I do not want to do all of the above every time I want to run my ember tests. I only want to do

yarn run:ember-tests

And I want the rest (1. starting the local MongoDB using the test-db database 2. starting the local server) to happen "internally" without me having to open up separate shells manually etc..)

Is this possible and how ?




Aucun commentaire:

Enregistrer un commentaire