Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
Add Benchmark#reset test for default event handlers.
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Dec 24, 2016
1 parent 6606edd commit 7c60187
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,25 @@

/*--------------------------------------------------------------------------*/

QUnit.module('Benchmark#reset');

(function() {
QUnit.test('should not reset default event handlers', function(assert) {
var handler = function() {};
Benchmark.options.onStart = handler;

var bench = Benchmark(),
clone = bench.clone({ 'events': { 'cycle': [function() {}] } });

clone.reset();

assert.deepEqual(clone.events, { 'start': [handler] });
delete Benchmark.options.onStart;
});
}());

/*--------------------------------------------------------------------------*/

QUnit.module('Benchmark#run');

(function() {
Expand Down

0 comments on commit 7c60187

Please sign in to comment.