Repository: dusk-network/rusk (language: rust)

Issue:
Create an alias for the main `__mocks__` folder
#### Summary

See: https://github.com/dusk-network/rusk/pull/2847#discussion_r1829046249


Discussion / hints:

Fix patch:
diff --git a/web-wallet/src/__mocks__/mockedOperationsStore.js b/web-wallet/src/__mocks__/mockedOperationsStore.js
deleted file mode 100644
index a28d7e379c..0000000000
--- a/web-wallet/src/__mocks__/mockedOperationsStore.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import { mockReadableStore } from "$lib/dusk/test-helpers";
-
-const content = { currentOperation: "something" };
-
-export default mockReadableStore(content);
diff --git a/web-wallet/src/__mocks__/AccountSyncer.js b/web-wallet/src/lib/__mocks__/AccountSyncer.js
similarity index 100%
rename from web-wallet/src/__mocks__/AccountSyncer.js
rename to web-wallet/src/lib/__mocks__/AccountSyncer.js
diff --git a/web-wallet/src/__mocks__/AddressSyncer.js b/web-wallet/src/lib/__mocks__/AddressSyncer.js
similarity index 100%
rename from web-wallet/src/__mocks__/AddressSyncer.js
rename to web-wallet/src/lib/__mocks__/AddressSyncer.js
diff --git a/web-wallet/src/__mocks__/Network.js b/web-wallet/src/lib/__mocks__/Network.js
similarity index 100%
rename from web-wallet/src/__mocks__/Network.js
rename to web-wallet/src/lib/__mocks__/Network.js
diff --git a/web-wallet/src/__mocks__/ProtocolDriver.js b/web-wallet/src/lib/__mocks__/ProtocolDriver.js
similarity index 100%
rename from web-wallet/src/__mocks__/ProtocolDriver.js
rename to web-wallet/src/lib/__mocks__/ProtocolDriver.js
diff --git a/web-wallet/src/__mocks__/Transactions.js b/web-wallet/src/lib/__mocks__/Transactions.js
similarity index 100%
rename from web-wallet/src/__mocks__/Transactions.js
rename to web-wallet/src/lib/__mocks__/Transactions.js
diff --git a/web-wallet/src/__mocks__/mockedWalletStore.js b/web-wallet/src/lib/__mocks__/mockedWalletStore.js
similarity index 100%
rename from web-wallet/src/__mocks__/mockedWalletStore.js
rename to web-wallet/src/lib/__mocks__/mockedWalletStore.js
diff --git a/web-wallet/vite-setup.js b/web-wallet/vite-setup.js
index deb17a5745..c92f54e56c 100644
--- a/web-wallet/vite-setup.js
+++ b/web-wallet/vite-setup.js
@@ -23,22 +23,22 @@ import { IntersectionObserver } from "./src/lib/dusk/mocks";
 vi.mock("@reown/appkit");
 
 vi.mock("./src/lib/vendor/w3sper.js/src/protocol-driver/mod", async () => ({
-  ...(await import("./src/__mocks__/ProtocolDriver.js")),
+  ...(await import("$lib/__mocks__/ProtocolDriver.js")),
 }));
 
 vi.mock(
   "./src/lib/vendor/w3sper.js/src/network/components/transactions",
   async (importOriginal) => ({
     ...(await importOriginal()),
-    Transactions: (await import("./src/__mocks__/Transactions.js")).default,
+    Transactions: (await import("$lib/__mocks__/Transactions.js")).default,
   })
 );
 
 vi.mock("./src/lib/vendor/w3sper.js/src/mod", async (importOriginal) => ({
   ...(await importOriginal()),
-  AccountSyncer: (await import("./src/__mocks__/AccountSyncer.js")).default,
-  AddressSyncer: (await import("./src/__mocks__/AddressSyncer.js")).default,
-  Network: (await import("./src/__mocks__/Network.js")).default,
+  AccountSyncer: (await import("$lib/__mocks__/AccountSyncer")).default,
+  AddressSyncer: (await import("$lib/__mocks__/AddressSyncer")).default,
+  Network: (await import("$lib/__mocks__/Network")).default,
 }));
 
 // Removing the console logging created by the walletConnect library after each test file


Test patch:
diff --git a/web-wallet/src/lib/components/__tests__/AddressPicker.spec.js b/web-wallet/src/lib/components/__tests__/AddressPicker.spec.js
index 2b68f52451..fa26343f48 100644
--- a/web-wallet/src/lib/components/__tests__/AddressPicker.spec.js
+++ b/web-wallet/src/lib/components/__tests__/AddressPicker.spec.js
@@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
 import { cleanup, render } from "@testing-library/svelte";
 import { get } from "svelte/store";
 
-import mockedWalletStore from "../../../__mocks__/mockedWalletStore";
+import mockedWalletStore from "$lib/__mocks__/mockedWalletStore";
 
 import { AddressPicker } from "..";
 
diff --git a/web-wallet/src/lib/wallet-treasury/__tests__/index.spec.js b/web-wallet/src/lib/wallet-treasury/__tests__/index.spec.js
index dbbe3ca376..efa5c88a39 100644
--- a/web-wallet/src/lib/wallet-treasury/__tests__/index.spec.js
+++ b/web-wallet/src/lib/wallet-treasury/__tests__/index.spec.js
@@ -10,7 +10,7 @@ import {
 } from "vitest";
 import { mapWith, pluckFrom } from "lamb";
 
-import mockedWalletStore from "../../../__mocks__/mockedWalletStore";
+import mockedWalletStore from "$lib/__mocks__/mockedWalletStore";
 
 import { cachePendingNotesInfo } from "$lib/mock-data";
 import {
diff --git a/web-wallet/src/routes/(app)/dashboard/__tests__/layout.spec.js b/web-wallet/src/routes/(app)/dashboard/__tests__/layout.spec.js
index 92b024b7c5..1a9a7a30b4 100644
--- a/web-wallet/src/routes/(app)/dashboard/__tests__/layout.spec.js
+++ b/web-wallet/src/routes/(app)/dashboard/__tests__/layout.spec.js
@@ -13,7 +13,7 @@ import { get } from "svelte/store";
 import { apiMarketData } from "$lib/mock-data";
 import { createCurrencyFormatter, luxToDusk } from "$lib/dusk/currency";
 
-import mockedWalletStore from "../../../../__mocks__/mockedWalletStore";
+import mockedWalletStore from "$lib/__mocks__/mockedWalletStore";
 
 import Layout from "../+layout.svelte";
 import { load } from "../+layout.js";
diff --git a/web-wallet/src/routes/(app)/dashboard/__tests__/page.spec.js b/web-wallet/src/routes/(app)/dashboard/__tests__/page.spec.js
index cfdde03ae0..bc94a457f5 100644
--- a/web-wallet/src/routes/(app)/dashboard/__tests__/page.spec.js
+++ b/web-wallet/src/routes/(app)/dashboard/__tests__/page.spec.js
@@ -1,7 +1,7 @@
 import { afterAll, afterEach, describe, expect, it, vi } from "vitest";
 import { cleanup } from "@testing-library/svelte";
 import { renderWithSimpleContent } from "$lib/dusk/test-helpers";
-import mockedWalletStore from "../../../../__mocks__/mockedWalletStore";
+import mockedWalletStore from "$lib/__mocks__/mockedWalletStore";
 import { stakeInfo, transactions } from "$lib/mock-data";
 
 import Dashboard from "../+page.svelte";
diff --git a/web-wallet/src/routes/(app)/dashboard/receive/__tests__/page.spec.js b/web-wallet/src/routes/(app)/dashboard/receive/__tests__/page.spec.js
index c3117c5f4c..c34b63d073 100644
--- a/web-wallet/src/routes/(app)/dashboard/receive/__tests__/page.spec.js
+++ b/web-wallet/src/routes/(app)/dashboard/receive/__tests__/page.spec.js
@@ -2,7 +2,7 @@ import { afterAll, afterEach, describe, expect, it, vi } from "vitest";
 import { cleanup, fireEvent, render } from "@testing-library/svelte";
 import { get } from "svelte/store";
 
-import mockedWalletStore from "../../../../../__mocks__/mockedWalletStore";
+import mockedWalletStore from "$lib/__mocks__/mockedWalletStore";
 
 import { walletStore } from "$lib/stores";
 
diff --git a/web-wallet/src/routes/(app)/dashboard/send/__tests__/page.spec.js b/web-wallet/src/routes/(app)/dashboard/send/__tests__/page.spec.js
index 98c4913494..fdf233828b 100644
--- a/web-wallet/src/routes/(app)/dashboard/send/__tests__/page.spec.js
+++ b/web-wallet/src/routes/(app)/dashboard/send/__tests__/page.spec.js
@@ -1,7 +1,7 @@
 import { afterAll, afterEach, describe, expect, it, vi } from "vitest";
 import { cleanup, fireEvent, render } from "@testing-library/svelte";
 
-import mockedWalletStore from "../../../../../__mocks__/mockedWalletStore";
+import mockedWalletStore from "$lib/__mocks__/mockedWalletStore";
 import { createCurrencyFormatter, luxToDusk } from "$lib/dusk/currency";
 
 import SendPage from "../+page.svelte";
diff --git a/web-wallet/src/routes/(app)/settings/__tests__/page.spec.js b/web-wallet/src/routes/(app)/settings/__tests__/page.spec.js
index cda6be7324..f72695f7be 100644
--- a/web-wallet/src/routes/(app)/settings/__tests__/page.spec.js
+++ b/web-wallet/src/routes/(app)/settings/__tests__/page.spec.js
@@ -10,7 +10,7 @@ import {
 import { act, cleanup, fireEvent, render } from "@testing-library/svelte";
 import { get } from "svelte/store";
 
-import mockedWalletStore from "../../../../__mocks__/mockedWalletStore";
+import mockedWalletStore from "$lib/__mocks__/mockedWalletStore";
 import * as navigation from "$lib/navigation";
 import {
   gasStore,