#!/bin/sh
# The compiled ES modules and the upstream test suites are only present in a
# built tree; on an installed system only the smoke test can be run.
set -e

if [ -f fluent-bundle/esm/index.js ]; then
	# @fluent/dom and @fluent/react are tested with jsdom, jest and
	# react-test-renderer, which are not available in Debian, and
	# temporal_test.js needs temporal-polyfill.
	mocha --ignore 'fluent-bundle/test/temporal_test.js' \
		'fluent-bundle/test/*_test.js' \
		'fluent-dedent/test/*_test.js' \
		'fluent-langneg/test/*_test.js' \
		'fluent-sequence/test/*_test.js' \
		'fluent-syntax/test/*_test.js'
else
	for module in bundle dedent dom langneg react sequence syntax; do
		node -e "require('@fluent/$module')"
	done
fi
