TEDxAmsterdam / ARCHIVED_Backend

Loopback NodeJS REST API Backend for TEDxAmsterdam
Other
5 stars 2 forks source link

Setup general testing framework #7

Open dligthart opened 8 years ago

dligthart commented 8 years ago

Setup general testing framework: unit/integration/e2e

IAmAnubhavSaini commented 8 years ago

Do you have any idea what we should use as of yet: Mocha/Chai, Jasmine, Karma, Istanbul, nemo, phantomjs?

el-davo commented 8 years ago

I would suggest using mocha and a library called supertest for making the rest calls. Also use gulp with mocha runner to make it easy to run tests.for example "gulp test". This is the setup I usually have for my loop back apps. It's important to get this setup asap as it will promote tdd. I find in my own apps that I do not have to run the app at all but just sufficient Api tests Is the way to go

dligthart commented 8 years ago

@el-davo would you like to give the testing implementation a try on the project?

el-davo commented 8 years ago

I would like to help. In fact ive checked out the code to take a look. One thing i wanted to run by you guys is, from my initial inspection it looks like I need to have a mysql server running to run locally. This is fine the only thing that could cause issues is when you introduce your ci server, for example travis ci. I'll explain the way I have this setup.

Strongloop allows changing databases fairly trivially depending on environments use the NODE_ENV environment variable. So what I usually do is when im running locally I use the inMemoryDb which is fairly good at mimicking real databases. So I use this locally and when i switch to staging and production it automagically switches to the mysql or mongo or whatever server.

So my question is what do you guys think of running a inMemoryDb for local development?

VuurVos commented 8 years ago

@dligthart can you suggest on this?