Skip to content

Commit 3c43871

Browse files
committed
fix(test): restart server when store becomes unavailable
Ensures the middleware uses the unavailable store mock
1 parent 3a18c2f commit 3c43871

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/spec/steps/http-steps.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,14 @@ Given("the SQLite store is clean", function () {
2020
// Store is already clean - initialized in Before hook
2121
});
2222

23-
Given("the idempotency store is unavailable", function () {
23+
Given("the idempotency store is unavailable", async function () {
2424
// Replace the SQLite store with an unavailable store
2525
this.store = new UnavailableIdempotencyStore();
26+
// Restart the server with the new store if it's already running
27+
if (this.server) {
28+
await this.stopServer();
29+
await this.startServer();
30+
}
2631
});
2732

2833
Given("an Idempotency-Key {string}", function (key) {

0 commit comments

Comments
 (0)