function JstdPlugin()

in jstd-scenario-adapter.js [58:96]


function JstdPlugin() {
  var nop = function() {};

  this.reportResult = nop;
  this.reportEnd = nop;
  this.runScenario = nop;

  this.name = 'Angular Scenario Adapter';

  /**
   * Called for each JSTD TestCase
   *
   * Handles only SCENARIO_TYPE test cases. There should be only one fake TestCase.
   * Runs all scenario tests (under one fake TestCase) and report all results to JSTD.
   *
   * @param {jstestdriver.TestRunConfiguration} configuration
   * @param {Function} onTestDone
   * @param {Function} onAllTestsComplete
   * @returns {boolean} True if this type of test is handled by this plugin, false otherwise
   */
  this.runTestConfiguration = function(configuration, onTestDone, onAllTestsComplete) {
    if (configuration.getTestCaseInfo().getType() != SCENARIO_TYPE) return false;

    this.reportResult = onTestDone;
    this.reportEnd = onAllTestsComplete;
    this.runScenario();

    return true;
  };

  this.getTestRunsConfigurationFor = function(testCaseInfos, expressions, testRunsConfiguration) {
    testRunsConfiguration.push(
        new jstestdriver.TestRunConfiguration(
            new jstestdriver.TestCaseInfo(
                'Angular Scenario Tests', function() {}, SCENARIO_TYPE), []));

    return true;
  };
}