Skip to content

Commit 9a41ca5

Browse files
authored
perf tests: enable in-browser performance profiling (#8579)
1 parent c5f931a commit 9a41ca5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/performance/utils.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ exports.runTests = function (PouchDB, suiteName, testCases, callback) {
6565

6666
t.test(testName, function (t) {
6767
t.plan(testCase.assertions);
68+
if (global.window && global.window.console && global.window.console.profile) {
69+
global.window.console.profile(testName);
70+
}
6871
var num = 0;
6972
function next() {
7073
nextTick(function () {
@@ -88,6 +91,9 @@ exports.runTests = function (PouchDB, suiteName, testCases, callback) {
8891
next();
8992
});
9093
t.test('teardown', function (t) {
94+
if (global.window && global.window.console && global.window.console.profileEnd) {
95+
global.window.console.profileEnd();
96+
}
9197
var testCaseTeardown = testCase.tearDown ?
9298
testCase.tearDown(db, setupObj) :
9399
Promise.resolve();

0 commit comments

Comments
 (0)