import assert from "node:assert/strict";
import test from "node:test";

import { resolveRuntimeChannel } from "./runtime-channel.js";

test("runtime channel distinguishes development, installed Windows, and native apps", () => {
  assert.equal(resolveRuntimeChannel({ isNative: false, explicit: "development", dev: false }), "development");
  assert.equal(resolveRuntimeChannel({ isNative: false, explicit: "", dev: true }), "development");
  assert.equal(resolveRuntimeChannel({ isNative: false, explicit: "", dev: false }), "windows");
  assert.equal(resolveRuntimeChannel({ isNative: true, explicit: "development", dev: true }), "native");
});

test("runtime channel rejects unknown build labels", () => {
  assert.equal(resolveRuntimeChannel({ isNative: false, explicit: "preview", dev: false }), "windows");
});
