本文へスキップ
製品デスクトップツールTASTECAD図面の確認TASTEFILESファイル管理TASTEFTPファイル転送TASTESSHリモートワークスペースTASTEZIP圧縮と展開TASTEWINMファイル管理開発ツールTASTECODERust 統合開発環境TASTESTUDIO統合開発・テスト環境TASTEETLデータ統合(ETL)サーバーTASTEREMOTEリモートデスクトップサーバーTASTEGEO空間情報サーバーTASTEMAILメールワークスペース投資TASTESTOCK株式自動売買デスクトップアプリはじめるダウンロードドキュメント購入すべての製品
マーケットプレイス
ニュース
技術ニュース今日の開発ニュース開発ドキュメントプログラミング言語RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDartWebフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngularサーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Expressアプリ・デスクトップ フレームワークTauriFlutterReact NativeElectronアルゴリズムアルゴリズムの基礎主要アルゴリズム発展アルゴリズム実務のアルゴリズム
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケースコミュニティガイド
協業技術移転ウェブサイト構築デスクトップアプリ構築リリース・決済パイプライン販売パートナーお問い合わせ
サービスリモートデスクトップインストールパッケージのカスタマイズ
TASTEDEV
製品

デスクトップツール

TASTECAD複雑な図面を、軽やかにひらくTASTEFILES必要なファイルだけを、最速でTASTEFTPファイルが行き交う、いちばん端正な道TASTESSHサーバーとあなたを、より確かにつなぐTASTEZIPより速くまとめ、より安全にひらくTASTEWINM2つの画面で整理する、キーボード中心のファイルマネージャー

開発ツール

TASTECODERust アプリの編集・ビルド・デバッグ・テストまでひとつのウィンドウでTASTESTUDIO編集からリモートテスト、承認した AI 修正までTASTEETL値を見ながら、データを運ぶ

サーバー

TASTEREMOTE自社サーバーで運用するリモートデスクトップTASTEGEOGeoServer 互換の空間情報サーバーを Rust で作り直しますTASTEMAILメールの主導権を、もう一度自分の手に

投資

TASTESTOCKいつ・何を。自分で決めたルールどおりに動く株式自動売買

はじめる

ダウンロード全製品の最新版ドキュメント各製品の使い方購入サブスクリプション・永久ライセンスすべての製品全製品を一覧で
すべての製品
マーケットプレイスニュース
技術

ニュース

今日の開発ニュース言語・フレームワーク・GitHub・AI の公式発表開発ドキュメント言語・フレームワーク・アルゴリズムのガイド

プログラミング言語

RustTypeScriptJavaScriptPythonGoC#JavaCC++KotlinDart

フレームワーク

Webフロントエンド フレームワークNext.jsReactVue.js · NuxtSvelteKitAngular
サーバー フレームワークSpring BootDjangoFastAPIASP.NET CoreNestJS · Express
アプリ・デスクトップ フレームワークTauriFlutterReact NativeElectron

アルゴリズム

アルゴリズムの基礎計算量解析 · ソート · 探索 · 基本データ構造 · 木構造とヒープ主要アルゴリズムグラフ探索 · 最短経路と最小全域木 · 動的計画法 · 貪欲法 · 分割統治法 · バックトラッキング発展アルゴリズム文字列アルゴリズム · 数学と整数論 · ビット演算 · セグメント木 · Union-Find実務のアルゴリズムコーディング面接対策 · LRUキャッシュ · レート制限 · コンシステントハッシュ法
開発ドキュメントをすべて見る
コミュニティ
プロジェクトビルダーと作品を探す開発ログ決定と試行錯誤プロンプト再利用できる指示AIツールの問題Claude・Codex・Gemini の問題と回避策ショーケース完成した成果コミュニティガイドオープンにつくる方法
協業
技術移転Rust・egui でネイティブアプリを作るウェブサイト構築10言語、アカウント、ドキュメントとダウンロードデスクトップアプリ構築Rust・egui、WebView なしリリース・決済パイプライン署名・MSI・deb・rpm・AppImage・ハッシュ販売パートナー紹介して決済額の30%お問い合わせ構築・提携・投資のご相談
サービス
リモートデスクトップブラウザから自分のパソコンへインストールパッケージのカスタマイズ必要な機能だけ、設定は事前に
購入
JA
한국어EnglishDeutschEspañolFrançaisItalianoPortuguês (Brasil)日本語简体中文繁體中文
ログイン
ログイン
TASTEDEV

小さなツールから、より良い開発へ。

support@tastedev.netTASTEDEVを支援
製品製品ラインナップ購入ドキュメントダウンロードマーケットプレイスサポート
コミュニティプロジェクト開発ログプロンプトAIツールの問題ショーケース
ポリシー会社概要プライバシーポリシー利用規約サブスクリプション規約返金ポリシーコミュニティガイドライン
アカウントログイン新規登録
訪問者
今日
昨日
累計閲覧
商号
GXSOFT
代表者
CHOI YOUNG GU
事業者登録番号
853-44-00368
所在地
9F V24, 351 Gyeongin-ro, Michuhol-gu, Incheon, Republic of Korea
電話
+82-10-4404-1523
メール
whitecalvin@tastedev.net
個人情報保護責任者
CHOI YOUNG GU

© 2026 TASTEDEV製品情報は検証済みの開発ソースに基づいています。リリース・改善中

Tauri ドキュメント
Tauri
Getting Started with TauriProject StructureCore ConceptsData and StateTestingDeployment
ディスカッション

Tauri ガイド · 5/6

Testing

この章は現在、英語でのみ提供しています。

A Tauri app is a Rust core and a web frontend working together, so it pays to test in layers. This chapter covers Rust unit tests, frontend tests with a mocked IPC layer, and WebDriver-based end-to-end tests that drive the real app window.

LayerToolsWhat it checks
Rust unit testscargo testCommands and business logic
Frontend testsVitest + @tauri-apps/api/mocksUI logic and invoke calls
End-to-end testsWebdriverIO or Selenium + WebDriverThe whole built app

Rust unit tests

A function marked #[tauri::command] is still a plain Rust function, so tests can call it directly. Even better, keep logic in pure functions and make commands a thin layer that calls them; that makes testing much easier.

// src-tauri/src/lib.rs
fn normalize_title(title: &str) -> String {
    title.trim().to_string()
}

#[tauri::command]
fn divide(a: f64, b: f64) -> Result<f64, String> {
    if b == 0.0 {
        return Err("cannot divide by zero".into());
    }
    Ok(a / b)
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn trims_title() {
        assert_eq!(normalize_title("  groceries "), "groceries");
    }

    #[test]
    fn divide_by_zero_is_error() {
        assert!(divide(1.0, 0.0).is_err());
        assert_eq!(divide(9.0, 3.0), Ok(3.0));
    }
}

Run the tests from src-tauri, or pass the manifest path from the repository root.

cd src-tauri && cargo test

# or, from the repository root
cargo test --manifest-path src-tauri/Cargo.toml

To exercise commands that take State or AppHandle through the real IPC path, enable the test feature of the tauri crate and use the mock runtime in tauri::test (mock_builder, mock_context, noop_assets) to build an app without opening a window.

Frontend tests with a mocked IPC

A plain browser or jsdom has no Tauri core behind it, so invoke cannot work as is. mockIPC from @tauri-apps/api/mocks fakes command responses, letting you test UI code with Vitest or Jest. Set environment to "jsdom" in your Vitest config.

// src/greet.test.ts
import { afterEach, beforeAll, expect, test } from "vitest";
import { randomFillSync } from "node:crypto";
import { clearMocks, mockIPC } from "@tauri-apps/api/mocks";
import { invoke } from "@tauri-apps/api/core";

beforeAll(() => {
  // jsdom has no WebCrypto implementation, so provide one
  Object.defineProperty(window, "crypto", {
    value: { getRandomValues: (buffer: any) => randomFillSync(buffer) },
  });
});

// Reset mocked state between tests
afterEach(() => clearMocks());

test("mocks the greet command", async () => {
  mockIPC((cmd, args) => {
    if (cmd === "greet") return `Hello, ${(args as { name: string }).name}!`;
  });
  await expect(invoke("greet", { name: "Tauri" })).resolves.toBe("Hello, Tauri!");
});

mockWindows from the same module fakes window labels. To assert which arguments the UI sends, record the args received inside mockIPC and check them afterwards.

End-to-end tests with WebDriver

To launch the built app, click buttons and verify results, use WebDriver, the W3C automation standard. The approach recommended by the official docs is the WebdriverIO Tauri service (@wdio/tauri-service); running npm create wdio@latest ./ and choosing Desktop Testing, then Tauri, generates the setup. The default embedded provider relies on the tauri-plugin-wdio-webdriver plugin, which runs a WebDriver server inside your app, and works on Windows, Linux and macOS. It is wise to include that plugin only in test builds.

// wdio.conf.ts
export const config: WebdriverIO.Config = {
  specs: ["./e2e/**/*.e2e.ts"],
  framework: "mocha",
  services: [
    ["tauri", {
      appBinaryPath: "./src-tauri/target/release/tauri-app",
      driverProvider: "embedded",
    }],
  ],
};
// e2e/greet.e2e.ts
describe("greeting screen", () => {
  it("shows a greeting after entering a name", async () => {
    await $("#greet-input").setValue("Tauri");
    await $("button[type='submit']").click();
    await expect($("#greet-msg")).toHaveText(/Tauri/);
  });
});

The traditional route is tauri-driver, installed with cargo install tauri-driver --locked, which wraps the platform's native WebDriver. On Windows it needs an msedgedriver.exe matching the installed Edge version on your PATH (a mismatch can make the suite hang while connecting); on Linux it needs WebKitWebDriver, packaged as webkit2gtk-driver on Debian-based systems. macOS has no WebDriver tool for WKWebView, so this route does not work there. If you do not use Node.js, pair it with another WebDriver client such as Selenium.

Linux CI runners have no display, so run end-to-end tests under a virtual display such as xvfb-run.

Summary

  • Move logic into pure functions, test it with cargo test and keep commands thin.
  • Fake Rust responses with mockIPC in Vitest or similar, and call clearMocks between tests.
  • End-to-end tests drive the built app through WebDriver; the WebdriverIO Tauri service is recommended, while tauri-driver supports only Windows and Linux.
この章について質問がありますか?
前の章Data and State次の章Deployment

コメント 0件

人気のコメント順新しい順

ログイン · ログインするとコメントできます。