Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes mocha.js YUI-compressible #1035

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions mocha.js
Original file line number Diff line number Diff line change
Expand Up @@ -1730,9 +1730,7 @@ var y = d * 365.25;
module.exports = function(val, options){
options = options || {};
if ('string' == typeof val) return parse(val);
return options.long
? long(val)
: short(val);
return options['long'] ? formatLong(val) : formatShort(val);
};

/**
Expand Down Expand Up @@ -1782,7 +1780,7 @@ function parse(str) {
* @api private
*/

function short(ms) {
function formatShort(ms) {
if (ms >= d) return Math.round(ms / d) + 'd';
if (ms >= h) return Math.round(ms / h) + 'h';
if (ms >= m) return Math.round(ms / m) + 'm';
Expand All @@ -1798,7 +1796,7 @@ function short(ms) {
* @api private
*/

function long(ms) {
function formatLong(ms) {
return plural(ms, d, 'day')
|| plural(ms, h, 'hour')
|| plural(ms, m, 'minute')
Expand Down Expand Up @@ -5595,4 +5593,4 @@ mocha.run = function(fn){
*/

Mocha.process = process;
})();
})();