Skip to content

Commit

Permalink
added tests for repeated calls to ReactPerf.start/stop
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuno Campos committed May 13, 2016
1 parent 201d032 commit 5b93a2b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/isomorphic/__tests__/ReactPerf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,27 @@ describe('ReactPerf', function() {
ReactPerf.stop();
expect(ReactPerf.isRunning()).toBe(false);
});

it('start has no effect when already running', () => {
expect(ReactPerf.isRunning()).toBe(false);

ReactPerf.start();
expect(ReactPerf.isRunning()).toBe(true);

ReactPerf.start();
expect(ReactPerf.isRunning()).toBe(true);

ReactPerf.stop();
expect(ReactPerf.isRunning()).toBe(false);
});

it('stop has no effect when already stopped', () => {
expect(ReactPerf.isRunning()).toBe(false);

ReactPerf.stop();
expect(ReactPerf.isRunning()).toBe(false);

ReactPerf.stop();
expect(ReactPerf.isRunning()).toBe(false);
});
});

0 comments on commit 5b93a2b

Please sign in to comment.