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 ?
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 ?
Just simply remove the db file. Usually, it is ~/.config/gcloud/emulators/datastore/WEB-INF/appengine-generated/local_db.bin
.
del
or rimraf
for that. Tested it, I can delete local_db.bin
while emulator is running, and it works fine. –
Yemane You could also send a POST /reset
request to the emulator, mentioned here.
© 2022 - 2024 — McMap. All rights reserved.