- fiddle will be loaded in different browser window/tab.
HTML
/* * Our application servers receive approximately 20 000 * http requests per second. Response timeout is 19000ms. * Implement a statistics collector that calculates the * median and average request response times for a 7 day * dataset. * * Assigment: * 1. Implement StatsCollector * 2. Write tests (below StatsCollector) */ 'use strict'; // State collector class StatsCollector { constructor(/*void*/) { } pushValue(responseTimeMs /*number*/) /*void*/ { // TODO implement } getMedian() /*number*/ { // TODO implement } getAverage() /*number*/ { // TODO implement } } // Configure Mocha, telling both it and chai to use BDD-style tests. mocha.setup("bdd"); chai.should(); describe('StatsCollector', function(){ it('it should have tests', function(){ true.should.equal(true); }); }); // Run all our test suites. Only necessary in the browser. mocha.run();
Title:
Description:
descr
Resources (comma separated, no spaces):
https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.13.0/polyfill.js,https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.15.0/lodash.js,https://cdnjs.cloudflare.com/ajax/libs/mocha/3.0.2/mocha.js,https://cdnjs.cloudflare.com/ajax/libs/mocha/3.0.2/mocha.css,https://cdnjs.cloudflare.com/ajax/libs/chai/3.5.0/chai.js
DTD:
Wrap (l/d/h/b)