Files
dbx/packages/app-tests/tauriRuntime.test.ts
T
t8y2 fabf2172e4 chore: migrate test runner from node:test/tsx to vitest
155 files, 1091 tests, 4.3s (2x faster than previous 9.1s).
2026-06-08 01:17:27 +08:00

13 lines
443 B
TypeScript

import { strict as assert } from "node:assert";
import { test } from "vitest";
import { isTauriRuntime } from "../../apps/desktop/src/lib/tauriRuntime.ts";
test("detects plain browser-like globals as non-Tauri runtime", () => {
assert.equal(isTauriRuntime({}), false);
});
test("detects Tauri globals", () => {
assert.equal(isTauriRuntime({ __TAURI_INTERNALS__: {} }), true);
assert.equal(isTauriRuntime({ __TAURI__: {} }), true);
});