Node.js v19.1.0 is now released, some updates in this version include:

Notable changes

Support for function mocking on the Node.js test runner #45326

The node:test module supports mocking through the top-level mock object during testing.


test('spies on an object method', (t) => {
  const number = {
    value: 5,
    add(a) {
      return this.value + a;
    },
  };
  t.mock.method(number, 'add');

  assert.strictEqual(number.add(3), 8);
  assert.strictEqual(number.add.mock.calls.length, 1);
});

fs.watch recursive support on Linux #45098

fs.watchuserecursive: trueOption to support recursive watch


const watcher = fs.watch(testDirectory, { recursive: true });
watcher.on('change', function(event, filename) {
});

Other notable changes

  • deps
    • Update ICU to 72.1 #45068
  • doc
    • Add lukekarrys to collaborators #45180
    • Add anonrig to collaborators #45002
  • lib
    • Remove experimental warning from fetch #45287
  • util
    • (SEMVER-MINOR) Add MIME utilities #21128
    • Improve text decoder decoding performance #45294

For details, please check the update instructions: https://nodejs.org/en/blog/release/v19.1.0/

#Nodejs #v1910 #officially #released #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *