From edcf1e47608e04086075d4e89f5fa8a5185a2181 Mon Sep 17 00:00:00 2001 From: flozdra Date: Thu, 26 Sep 2024 09:26:20 +0200 Subject: [PATCH] docs: update restore method examples --- content/docs/concepts/dependency_injection.md | 5 ++++- content/docs/testing/mocks_and_fakes.md | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/content/docs/concepts/dependency_injection.md b/content/docs/concepts/dependency_injection.md index 80140d10..e3413ad6 100644 --- a/content/docs/concepts/dependency_injection.md +++ b/content/docs/concepts/dependency_injection.md @@ -473,8 +473,11 @@ Once a swap has been defined, the container will use it instead of the actual cl ```ts app.container.restore(UserService) +// Restore UserService and PostService +app.container.restoreAll([UserService, PostService]) + // Restore all -app.container.restore() +app.container.restoreAll() ``` ## Contextual dependencies diff --git a/content/docs/testing/mocks_and_fakes.md b/content/docs/testing/mocks_and_fakes.md index d9fc4147..43a6e485 100644 --- a/content/docs/testing/mocks_and_fakes.md +++ b/content/docs/testing/mocks_and_fakes.md @@ -69,8 +69,11 @@ Once the test has been completed, you must restore the fake using the `container ```ts app.container.restore(UserService) +// Restore UserService and PostService +app.container.restoreAll([UserService, PostService]) + // Restore all -app.container.restore() +app.container.restoreAll() ``` ## Mocks and stubs using Sinon.js