FEP-d9ad proposes to Create Conformance Tests for Fediverse Enhancement Proposals.
This FEP furthermore proposes to do so by implementing FEP-d9ad Conformance Test specifications as ECMAScript Modules (i.e. JavaScript Modules).
a resource that can be import
ed in ECMAScript/JavaScript into a module reference
an ECMAScript Module used to implement a FEP-d9ad-style Conformance Test
an ECMAScript Object used to implement a FEP-d9ad-style Conformance Test. There may be one or more Test Objects in one import
able Test Module.
FEP testers MAY publish implementations of their test specifications as an [ECMAScript Object][] following the recommendations in this proposal. Such modules may be referred to as Test Objects.
Test Objects MUST have a property named type
whose value is an Array containing https://w3id.org/fep/c551/Test
.
Test Objects MUST have a property named name
whose value is a string.
Test Objects MUST have a property named run
, and
run
MUST be a functionrun
MUST be a Promise that resolves to an object
outcome
whose value is a string
run
function SHOULD be resilient to being evaluated and run in various ECMAScript runtimes (e.g. node.js or a web browser like chromium)Test Objects SHOULD have a property named @context
whose value is an Array containing https://www.w3.org/ns/activitystreams
.
FEP testers MAY publish implementations of their test specifications as an ECMAScript Module following the recommendations in this proposal. Such modules may be referred to as Test Modules.
Test Modules SHOULD have no imports. This is to ensure portability of the test modules.
Test Modules MAY export a default export object that is a Test Object
export default {
name: "My first test",
run: () => ({ outcome: "passed" }),
"@type": ["https://w3id.org/fep/c551/Test"],
}