How to reset emulator DB before each test?

折月煮酒 提交于 2020-08-08 05:25:48

问题


I'm running tests with the gcloud datastore emulator for node.
I want to reset the db before each test.

Is there a quick way like a 'drop' command or something I can use in a beforeEach block ?


回答1:


Just simply remove the db file. Usually, it is ~/.config/gcloud/emulators/datastore/WEB-INF/appengine-generated/local_db.bin.




回答2:


You could also send a POST /reset request to the emulator, mentioned here.



来源:https://stackoverflow.com/questions/39027941/how-to-reset-emulator-db-before-each-test

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!