Stryker

Timer.js - Stryker report

Summary

File
Mutation score
# Killed
# Survived
# Timeout
# No coverage
# Errors
Total detected
Total undetected
Total mutants
Timer.js
96%
30/31 30 1 0 0 0 30 1 31

Code

"use strict";
var Timer = (function () 0{
    function Timer() 1{
        this.reset();
    }
    Timer.prototype.reset = function () 2{
        this.start = new Date();
    };
    Timer.prototype.humanReadableElapsed = function () 3{
        var elapsedMs = 4new Date().getTime() - this.start.getTime();
        var elapsedSeconds = Math.floor(5elapsedMs / 1000);
        return 6Timer.humanReadableElapsedMinutes(elapsedSeconds) + Timer.humanReadableElapsedSeconds(elapsedSeconds);
    };
    Timer.humanReadableElapsedSeconds = function (elapsedSeconds) 7{
        var restSeconds = 8elapsedSeconds % 60;
        if (91011restSeconds === 1) 12{
            return 13restSeconds + " second";
        }
        else 14{
            return 15restSeconds + " seconds";
        }
    };
    Timer.humanReadableElapsedMinutes = function (elapsedSeconds) 16{
        var elapsedMinutes = Math.floor(17elapsedSeconds / 60);
        if (18192021elapsedMinutes > 1) 22{
            return 23elapsedMinutes + " minutes ";
        }
        else if (24252627elapsedMinutes > 0) 28{
            return 29elapsedMinutes + " minute ";
        }
        else 30{
            return '';
        }
    };
    return Timer;
}());
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = Timer;
//# sourceMappingURL=Timer.js.map