UNPKG

lawl-spec-reporter

Version:

Spec reporter for jasmine, based on jasmine-spec-reporter, outputs in LolSpeak

33 lines (28 loc) 1.3 kB
// Generated by CoffeeScript 1.9.2 (function() { var SpecReporter; SpecReporter = require('../src/lawl-spec-reporter.js'); describe('duration', function() { return it('should be human readable', function() { var hours, mins, reporter, secs; secs = 1000; mins = 60 * secs; hours = 60 * mins; reporter = new SpecReporter(); this.formatDuration = reporter.metrics.formatDuration; expect(this.formatDuration(0)).toBe('0 SECZ'); expect(this.formatDuration(10)).toBe('0.01 SECZ'); expect(this.formatDuration(999)).toBe('0.999 SECZ'); expect(this.formatDuration(secs)).toBe('1 SECZ'); expect(this.formatDuration(10 * secs)).toBe('10 SECZ'); expect(this.formatDuration(59 * secs)).toBe('59 SECZ'); expect(this.formatDuration(60 * secs)).toBe('1 MINZ'); expect(this.formatDuration(61 * secs)).toBe('1 MINZ 1 SECZ'); expect(this.formatDuration(59 * mins)).toBe('59 MINZ'); expect(this.formatDuration(60 * mins)).toBe('1 HRZ'); expect(this.formatDuration(3 * hours + 28 * mins + 53 * secs + 127)).toBe('3 HRZ 28 MINZ 53 SECZ'); return expect(this.formatDuration(3 * hours + 53 * secs + 127)).toBe('3 HRZ 53 SECZ'); }); }); }).call(this); //# sourceMappingURL=duration-format.spec.js.map