From 2836ee649470741a0e86024c9f381bf0a1e6fca8 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Sat, 5 Sep 2026 19:08:19 +0200 Subject: [PATCH] test(player): use the existing frontend_test wiring for api.test.mjs main already runs the player's static JS unit tests via `make test-frontend` over pkg/service/soundtouchweb/frontend_test/*.test.mjs, wired into .github/workflows/browser-tests.yml. That target was added by PR #672 and this change predates it. api.test.mjs was placed in static/js/ instead and run by a second `node --test` invocation bolted onto test-browser, behind a new NODE variable. That is a parallel test-wiring convention for one file, and it also mixes a test into the directory that is served to browsers as static assets. Move the file next to the other frontend tests and revert the Makefile change; the existing target and CI job pick it up unchanged. Co-Authored-By: Claude Opus 5 (1M context) --- Makefile | 2 -- .../soundtouchweb/{static/js => frontend_test}/api.test.mjs | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) rename pkg/service/soundtouchweb/{static/js => frontend_test}/api.test.mjs (97%) diff --git a/Makefile b/Makefile index 0b576639..38814782 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,6 @@ GOTEST=$(GOCMD) test GOGET=$(GOCMD) get GOMOD=$(GOCMD) mod GOFMT=gofmt -NODE?=node # Build parameters BINARY_NAME=soundtouch-cli @@ -156,7 +155,6 @@ test-coverage: test-browser: @echo "Running browser-level compatibility tests..." $(GOTEST) -tags browsertest -v ./pkg/service/soundtouchweb/... - $(NODE) --test pkg/service/soundtouchweb/static/js/api.test.mjs # Unit tests for the embedded player's static JS modules (see # pkg/service/soundtouchweb/frontend_test/), run via Node's built-in test diff --git a/pkg/service/soundtouchweb/static/js/api.test.mjs b/pkg/service/soundtouchweb/frontend_test/api.test.mjs similarity index 97% rename from pkg/service/soundtouchweb/static/js/api.test.mjs rename to pkg/service/soundtouchweb/frontend_test/api.test.mjs index 2753f835..99b43a37 100644 --- a/pkg/service/soundtouchweb/static/js/api.test.mjs +++ b/pkg/service/soundtouchweb/frontend_test/api.test.mjs @@ -1,7 +1,7 @@ import assert from 'node:assert/strict'; import test from 'node:test'; -import { api } from './api.js'; +import { api } from '../static/js/api.js'; test('selectSource posts the exact source and account body', async () => { const requests = [];