Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Tests: Add hook for testing implementation internals #6

@gabrielschulhof

Description

@gabrielschulhof

Something like

/* preamble */
...
function internalAssertion( testName, checkpoint ) {
  if ( arguments.length === 0 ) {
    return 5 /* number of internal assertions to add to the expected number of assertions */;
  } else {
    /* make assertions about the internal state based on testName and checkpoint */
  }
}
...
/* usage */
var testName = "Discovery";
console.log( JSON.stringify( {
  assertionCount: 3 + ( typeof internalAssertion === "function" ? internalAssertion() : 0 )
} ) );
...
if ( typeof internalAssertion === "function" ) {
  internalAssertion( testName, "afterResourceFound" );
}
/* usage */

... and document the possible values of testName and checkpoint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions