diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..76ac9a4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,18 @@ +name: CI + +on: + push: + branches: ["main"] + pull_request: + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + - run: bun install --frozen-lockfile + - run: bun run check + - run: bun run build diff --git a/tests/native.test.ts b/tests/native.test.ts index 61d8cb1..ad70a0c 100644 --- a/tests/native.test.ts +++ b/tests/native.test.ts @@ -1,4 +1,7 @@ import { describe, expect, test } from "bun:test"; +import { mkdirSync, mkdtempSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; import { createMusicApplicationSource, decodeArtworkData, @@ -70,10 +73,10 @@ describe("native artwork", () => { }); describe("native Music.app resolution", () => { - test("uses the system Music.app path when it exists", () => { - expect(createMusicApplicationSource("/System/Applications/Music.app")).toBe( - 'Application("/System/Applications/Music.app")', - ); + test("uses the Music.app path when it exists", () => { + const appPath = join(mkdtempSync(join(tmpdir(), "setlist-")), "Music.app"); + mkdirSync(appPath); + expect(createMusicApplicationSource(appPath)).toBe(`Application(${JSON.stringify(appPath)})`); }); test("falls back to the application name when the system path is missing", () => {