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) <noreply@anthropic.com>
This commit is contained in:
Tobias Gesellchen
2026-09-05 20:36:58 +02:00
co-authored by Claude Opus 5
parent 098cc1c66f
commit 2836ee6494
2 changed files with 1 additions and 3 deletions
-2
View File
@@ -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
@@ -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 = [];