build-targets.test.ts
This file
Path
apps/cli/test/build-targets.test.ts
29 lines · 1.0 KiB · TypeScript
Last changed by
Merge build/comments-cli-protocol-checks into mainoscabrielbefore adoptionc86204f
History of this fileTake it
Close W7: cross-compile the release again, guard pi's edits, and keep the swarm out of this checkoutoscabrielbefore adoption842f042
lines 1–29why, one step back1import { describe, expect, it } from "@effect/vitest";2import { Option } from "effect";34import { npmMachineOf } from "../build-targets.ts";56describe("a compile target's machine, as npm names it", () => {7 it("reads the release's two targets, with or without Bun's prefix", () => {8 expect(npmMachineOf("bun-darwin-arm64")).toStrictEqual(9 Option.some({ cpu: "arm64", os: "darwin" })10 );11 expect(npmMachineOf("linux-x64")).toStrictEqual(12 Option.some({ cpu: "x64", os: "linux" })13 );14 });1516 it("calls Windows win32, and drops Bun's modifiers", () => {17 expect(npmMachineOf("bun-windows-x64-baseline")).toStrictEqual(18 Option.some({ cpu: "x64", os: "win32" })19 );20 expect(npmMachineOf("linux-arm64-musl")).toStrictEqual(21 Option.some({ cpu: "arm64", os: "linux" })22 );23 });2425 it("knows no machine for a target Bun does not name", () => {26 expect(npmMachineOf("bun-plan9-x64")).toStrictEqual(Option.none());27 expect(npmMachineOf("darwin")).toStrictEqual(Option.none());28 });29});