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

Tests: Add hook for testing implementation internals #6

Open
gabrielschulhof opened this issue Sep 3, 2016 · 0 comments
Open

Tests: Add hook for testing implementation internals #6

gabrielschulhof opened this issue Sep 3, 2016 · 0 comments

Comments

@gabrielschulhof
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant