Files
factorio-clusterio/.github/workflows/tap.yml
T
bbassieandClaude Opus 5.5 b73b584d2d Add a TAP test suite alongside mocha
Tests live in tests/, mirroring each package's src, and in
plugins/*/test/*.test.ts. They are TypeScript run by Node's type stripping,
so the @tapjs/typescript plugin is disabled and `pnpm install` runs tap build
to apply that.

The first tests cover the largest lib files: link, subscriptions, config
classes and prometheus. A shared helper checks the JSON serialisable class
pattern, and one test runs it on every serialisable class lib exports, with
samples generated from each class's schema.

Known bugs the new tests found are marked todo. Mocha, codecov and the
existing CI matrix are unchanged; tap.yml runs the new suite on the latest
Node.js and Factorio.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 22:21:09 +00:00

39 lines
1.1 KiB
YAML

# TAP test suite, run alongside the mocha suite in node.js.yml until it reaches
# similar coverage. Only the latest Node.js and Factorio are tested here.
name: TAP tests
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.sha || github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: 26.x
FACTORIO_VERSION: 2.1.17
jobs:
changes:
uses: ./.github/workflows/ci-changes.yml
test:
needs: changes
if: ${{ !cancelled() && needs.changes.outputs.build_and_test != 'false' }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- name: Prepare and install
uses: ./.github/actions/pnpm-install
with:
node-version: ${{ env.NODE_VERSION }}
- name: Use Factorio ${{ env.FACTORIO_VERSION }}
run: wget -q -O factorio.tar.gz https://www.factorio.com/get-download/${{ env.FACTORIO_VERSION }}/headless/linux64 && tar -xf factorio.tar.gz && rm factorio.tar.gz
- name: Type check tests
run: pnpm run test:typecheck
- name: Run tests
run: pnpm run test:tap