mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
15 lines
447 B
JavaScript
15 lines
447 B
JavaScript
|
'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');
|
||
|
}
|