Files
zoneminder/.github/workflows/ci-js-tests.yml
T
Isaac ConnorandClaude Opus 5 5b30a79568 ci: run the JavaScript tests
tests/js holds eight files and 154 assertions covering auth-helpers,
EventStream, MonitorStream, table-helpers, the encoder templates and the zone
object size tool. No workflow ran any of them, so they only ever executed if
someone thought to run them by hand, and ci-eslint only checks that the source
parses and conforms to style.

The tests need nothing installed: they use node builtins (assert, fs, path,
vm) and files from web/js, so there is no npm install step and no submodule
to fetch.

The loop keeps going after a failure and fails at the end, so one CI run
reports every broken test rather than stopping at the first.

Verified by extracting the run script from the YAML and executing it: exit 0
with all eight files run, and after deliberately failing an assertion in the
first file, exit 1 with all eight still run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UvTCzCbvGt8xKQRNCSA7o8
2026-09-11 20:13:02 -05:00

32 lines
754 B
YAML

name: CI JS Tests
on:
push:
branches:
- '*'
pull_request:
branches: [ master ]
permissions:
contents: read
jobs:
js-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
# The tests require only node builtins (assert, fs, path, vm) plus files
# from web/js, so there is nothing to install and no submodule to fetch.
- name: Run the JavaScript tests
run: |
node --version
failed=0
for t in tests/js/*.test.js; do
echo "--- $t"
# Run every file even after one fails: a single CI run should report
# all the broken tests, not just the first.
node "$t" || failed=1
done
exit $failed