Consider having a test database to run your tests on. One way of doing this is to set the database config through environment variables, and I see many people do so (example: Test environment in Node.js / Express application). However, to me this seems a bit dangerous. All it requires is that sometime in the future, by mistake, the env variable is set to development or production and suddenly we'll be messing with (or even wiping) the wrong database. Is there a better way to do this?
(I'm using node/mocha/should.js to run my tests)
Aucun commentaire:
Enregistrer un commentaire