Skip to main content

Module tests

Module tests 

Source
Expand description

VAPP-196 (eApps T1): PACKAGE TESTS, the twin of packages/exponential-ui/src/host/tests.ts. A package carries tests: [{name, records?, now?, as?, expr | query | action, expect}]; validate_package runs every one on an otherwise valid package, each against its OWN in-memory store seeded with records, on a fixed clock (now, UTC) as the member as. A failing test is an install issue at /tests/<i> (expected vs got). Locked by fixtures/package-tests.json.

Structs§

PackageTestResult
One test’s outcome (runPackageTests).

Constants§

PACKAGE_TEST_DEFAULT_AS
The member a test runs as when it names none.
PACKAGE_TEST_DEFAULT_NOW
The clock a test runs at when it names none.
PACKAGE_TEST_DEFAULT_ROLE
eApps R3: the team role a test runs as when it names none, and the roles it may name.
PACKAGE_TEST_KINDS
What a test runs: exactly one of these keys.
PACKAGE_TEST_LIMIT_GOT_MAX
The characters (code points) of a got an issue prints.
PACKAGE_TEST_LIMIT_TESTS
Caps: tests per package.
PACKAGE_TEST_ROLES

Functions§

package_test_issues
The failing tests as install issues (/tests/<i>).
run_package_tests
Every test of a package, run (a package whose tests are malformed runs none).
test_failure
The issue text of a failed test: expected vs got, both canonical JSON (got cut at PACKAGE_TEST_LIMIT_GOT_MAX code points + …).
test_matches
Does got satisfy expect? An object matches by the keys it names (recursively; a missing key reads null), a list item by item with the same length, anything else by JSON equality (1 equals 1.0).
validate_package_tests
The shape issues of a package’s tests (they run only without any).