Fixture features

June 12, 2026 ยท View on GitHub

Fixture features are specific fixture characteristics (like "uses RDM" or "uses fine channel before coarse channel"), especially ones that have produced or are likely to produce bugs and errors.

We use fixture features for the following purposes:

  • Generate a minimal collection of test fixtures that cover all fixture features so we can check all special cases with minimum work
  • (planned) The fixture editor can only edit / import fixtures that only use editor-compatible fixture features
  • (planned) Search for fixtures with specific fixture features (mainly for testing)

Fixture features are saved in the the lib/fixture-features/ directory as JS modules that export an array of features. It is advised to put similar features into one module. A sample module looks like this:

export default [{
  // Optional, default is the filename (without '.js', succeeded by `-${i}` if
  // multiple features per module are provided). Must be unique!
  id: 'fine-channel-alias',

  // Required. Used in generated table header. Try to be as short as possible! Markdown is allowed.
  name: 'Fine channels (16bit)',

  // Optional. Is used as a footnote in generated table header. Markdown is allowed.
  description: 'Whether a channel defines exactly one fine channel alias',

  /**
   * Required. Checks if the given fixture uses this feature.
   * @param {Readonly<Fixture>} fixture - The Fixture instance, see fixture-model.md
   * @returns {boolean} true if the fixture uses the feature
   */
  hasFeature: (fixture) => fixture.coarseChannels.some(
    (channel) => channel.fineChannelAliases.length === 1,
  ),
}];

Test fixtures are generated by calling npm run build:test-fixtures or simply npm run build. They are saved machine-readable as tests/test-fixtures.json and human-readable as tests/test-fixtures.md.