#!/bin/sh
set -e

# fast-check is not packaged in Debian. Keep the deterministic property tests,
# but omit the randomized tests that require it.
# The npm package export test requires pnpm and tests an npm tarball rather
# than the Debian package.
# The DFSG-filtered source excludes the harvested corpora. Omit only the
# three tests which load them; keep tests using synthetic corpus fixtures.
find test -type f \( -name '*.test.js' -o -name '*.test.cjs' \) \
    \( ! -path 'test/property/*' -o -name 'naive-*.test.js' \) \
    ! -path 'test/integration/package-exports.test.js' \
    ! -path 'test/conformance/corpus.test.js' \
    ! -path 'test/conformance/invalid-corpus.test.js' \
    ! -path 'test/conformance/preprocessor-corpus.test.js' \
    -exec node --test --test-reporter=spec {} +
