summaryrefslogtreecommitdiff
path: root/test/parallel/test-tojson-perf_hooks.js
blob: 2a716fc4478c29b94d9cdecffb20e350914f7a11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
'use strict';

require('../common');
const assert = require('assert');
const { performance } = require('perf_hooks');

// Test toJSON for performance object
{
  assert.strictEqual(typeof performance.toJSON, 'function');
  const jsonObject = performance.toJSON();
  assert.strictEqual(typeof jsonObject, 'object');
  assert.strictEqual(jsonObject.timeOrigin, performance.timeOrigin);
  assert.strictEqual(typeof jsonObject.nodeTiming, 'object');
}