Tauri Core API - v2.6.0
    Preparing search index...

    Function clearMocks

    • Clears mocked functions/data injected by the other functions in this module. When using a test runner that doesn't provide a fresh window object for each test, calling this function will reset tauri specific properties.

      Example

      import { mockWindows, clearMocks } from "@tauri-apps/api/mocks"

      afterEach(() => {
      clearMocks()
      })

      test("mocked windows", () => {
      mockWindows("main", "second", "third");

      expect(window.__TAURI_INTERNALS__).toHaveProperty("metadata")
      })

      test("no mocked windows", () => {
      expect(window.__TAURI_INTERNALS__).not.toHaveProperty("metadata")
      })

      Returns void

      1.0.0