#!/bin/sh
set -eu

cd polyfill
# The published-package test needs the installed artifact in autopkgtest.
if [ -n "${AUTOPKGTEST_TMP:-}" ]; then
    ln -s /usr/share/nodejs/temporal-polyfill dist
fi
find src -name '*.test.ts' -print0 | sort -z | xargs -0 node \
    --import ../debian/tests/pkg-js/loader.mjs --test --test-concurrency=1 ../debian/tests/pkg-js/api.test.mjs
