Files
Kmake/test/parallel/test-util-primordial-monkeypatching.js
2026-05-26 23:36:42 -07:00

12 lines
349 B
JavaScript

'use strict';
// Monkeypatch Object.keys() so that it throws an unexpected error. This tests
// that `util.inspect()` is unaffected by monkey-patching `Object`.
require('../common');
const assert = require('assert');
const util = require('util');
Object.keys = () => { throw new Error('fhqwhgads'); };
assert.strictEqual(util.inspect({}), '{}');