Files
weave-scope/client/app/scripts/utils/__tests__/time-utils-test.js
Filip Barl 2183a93916 Time Travel 3.0 (#2703)
* Experimental.

* Getting somewhere.

* Good zooming behaviour.

* Working timeline zooming & panning.

* Clickable timestamps.

* Dragging cursor

* Timeline panning buttons.

* Capping at current time.

* Scale limits.

* Better ticks.

* Time tags fading in smoothly.

* Removed seconds.

* Better tick spacing.

* Vertical panning as zooming.

* Organizing the code..

* Replaced d3-zoom with native events.

* Got rid of scaleX

* More code beautified.

* Almost done polishing the code.

* Some cleanup.

* Better request triggers.

* More cleaning up.

* Styled the timestamp input.

* Final cleanup.

* Update yarn.lock

* Zoom tracking.

* Animate timeline translations.

* Fixed the PAUSE button glitch and updating the time control info.

* Opacity fix and timeline arrows removed.

* Fixed the red vertical bar.

* Use preventDefault() on timeline scrolling.
2017-07-27 14:40:20 +02:00

19 lines
448 B
JavaScript

import expect from 'expect';
import { timer } from '../time-utils';
describe('timer', () => {
it('records how long a function takes to execute', () => {
const add100k = (number) => {
for (let i = 0; i < 100000; i += 1) {
number += 1;
}
return number;
};
const timedFn = timer(add100k);
const result = timedFn(70);
expect(result).toEqual(100070);
expect(timedFn.time).toBeA('number');
});
});