'use strict';
const path = require('path');
function simpleReporter(results) {
  let passed = 0;
  let failed = 0;
  let lastPassed = true;

  results.on('pass', function (test) {
    passed++;

    clearPassed();
    lastPassed = true;
    process.stdout.write('PASS ' + test.file);
  });

  results.on('fail', function (test) {
    failed++;
    clearPassed();
    lastPassed = false;
    console.log('FAIL ' + test.file);
    console.log('  ' + test.result.message);
    console.log('');
  });

  results.on('end', function () {
    clearPassed();

    console.log('Ran ' + (passed + failed) + ' tests')
    console.log(passed + ' passed')
    console.log(failed + ' failed')
  });

  function clearPassed() {
    if (lastPassed) {
      if (process.stdout.isTTY) {
        process.stdout.clearLine();
        process.stdout.cursorTo(0);
      } else {
        process.stdout.write('\n');
      }
    }
  }
}

module.exports = simpleReporter;

'use strict';
const path = require('path');
function simpleReporter(results) {
  let passed = 0;
  let failed = 0;
  let lastPassed = true;

  results.on('pass', function (test) {
    passed++;

    clearPassed();
    lastPassed = true;
    process.stdout.write(`PASS ${test.file}`);
  });

  results.on('fail', function (test) {
    failed++;
    clearPassed();
    lastPassed = false;
    console.log(`FAIL ${test.file}${test.strictMode ? ' (strict)' : ' (non-strict)'}`);
    console.log(`  ${test.result.message}`);
    console.log('');
  });

  results.on('end', function () {
    clearPassed();

    console.log(`Ran ${(passed + failed)} tests`);
    console.log(`${passed} passed`);
    console.log(`${failed} failed`);
  });

  function clearPassed() {
    if (lastPassed) {
      if (process.stdout.isTTY) {
        process.stdout.clearLine();
        process.stdout.cursorTo(0);
      } else {
        process.stdout.write('\n');
      }
    }
  }
}

module.exports = simpleReporter;

Mark failures with "(strict)" or "(non-strict)"
Mark failures with "(strict)" or "(non-strict)"

Before:

$ test262-harness --hostType jsc --hostPath `which jsc` test/language/function-code/each-param-has-own-*.js
FAIL test/language/function-code/each-param-has-own-non-shared-eval-scope.js
  Expected a ReferenceError to be thrown but no exception was thrown at all

FAIL test/language/function-code/each-param-has-own-scope.js
  Expected a ReferenceError to be thrown but no exception was thrown at all

Ran 4 tests
2 passed
2 failed

After:

$ test262-harness --hostType jsc --hostPath `which jsc` test/language/function-code/each-param-has-own-*.js
FAIL test/language/function-code/each-param-has-own-non-shared-eval-scope.js (non-strict)
  Expected a ReferenceError to be thrown but no exception was thrown at all

FAIL test/language/function-code/each-param-has-own-scope.js (non-strict)
  Expected a ReferenceError to be thrown but no exception was thrown at all

Ran 4 tests
2 passed
2 failed
