From 468f1106091fa3faaa2ed0efb0b57227a23c7ed6 Mon Sep 17 00:00:00 2001 From: Scott Santucci Date: Fri, 1 Jul 2016 02:21:33 -0400 Subject: [PATCH] Get interface name list from collection (#2343) Get interface name list from collection; closes #2317 --- bin/_mocha | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/_mocha b/bin/_mocha index ad4ed40373..970e12aeee 100755 --- a/bin/_mocha +++ b/bin/_mocha @@ -11,6 +11,7 @@ var program = require('commander'), exists = fs.existsSync || path.existsSync, Mocha = require('../'), utils = Mocha.utils, + interfaceNames = Object.keys(Mocha.interfaces), join = path.join, cwd = process.cwd(), getOptions = require('./options'), @@ -74,7 +75,7 @@ program .option('-r, --require ', 'require the given module') .option('-s, --slow ', '"slow" test threshold in milliseconds [75]') .option('-t, --timeout ', 'set test-case timeout in milliseconds [2000]') - .option('-u, --ui ', 'specify user-interface (bdd|tdd|exports)', 'bdd') + .option('-u, --ui ', 'specify user-interface (' + interfaceNames.join('|') + ')', 'bdd') .option('-w, --watch', 'watch files for changes') .option('--check-leaks', 'check for global variable leaks') .option('--full-trace', 'display the full stack trace') @@ -156,10 +157,9 @@ program.on('reporters', function(){ program.on('interfaces', function(){ console.log(''); - console.log(' bdd'); - console.log(' tdd'); - console.log(' qunit'); - console.log(' exports'); + interfaceNames.forEach(function(interfaceName) { + console.log(' ' + interfaceName); + }); console.log(''); process.exit(); });