Gyro
Gyro

Reputation: 1045

How to reset emulator DB before each test?

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 ?

Upvotes: 2

Views: 815

Answers (2)

Renato Back
Renato Back

Reputation: 756

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

Upvotes: 1

Hung Hoang
Hung Hoang

Reputation: 717

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

Upvotes: 1

Related Questions