diff --git a/__tests__/registries/npm-registry.js b/__tests__/registries/npm-registry.js index e9deb193e1..6f7551174f 100644 --- a/__tests__/registries/npm-registry.js +++ b/__tests__/registries/npm-registry.js @@ -7,8 +7,8 @@ import {BufferReporter} from '../../src/reporters/index.js'; import homeDir, {home} from '../../src/util/user-home-dir.js'; function basicAuth(username, password): string { - const pw = new Buffer(String(password), 'base64').toString(); - return new Buffer(String(username) + ':' + pw).toString('base64'); + const pw = Buffer.from(String(password), 'base64').toString(); + return Buffer.from(String(username) + ':' + pw).toString('base64'); } describe('normalizeConfig', () => {