This is a proposal to enhance the fediverse by adding tests to activitypub-testing and using them to test conformance with behaviors described in other FEPs.

Context

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).

Definitions

ECMAScript Module

a resource that can be imported in ECMAScript/JavaScript into a module reference

Test Module

an ECMAScript Module used to implement a FEP-d9ad-style Conformance Test

Test Object

an ECMAScript Object used to implement a FEP-d9ad-style Conformance Test. There may be one or more Test Objects in one importable Test Module.

Proposal

Test Objects

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

Test Objects SHOULD have a property named @context whose value is an Array containing https://www.w3.org/ns/activitystreams.

Test Modules

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

Example Test Module

export default {
  name: "My first test",
  run: () => ({ outcome: "passed" }),
  "@type": ["https://w3id.org/fep/c551/Test"],
}
Conformance requirements are indicated by sentences containing MUST a la RFC2119.

License

CC BY-SA 4.0