Skip to content

Commit 1aad91f

Browse files
authored
Merge pull request #1891 from cjihrig/buffer
test: replace use of deprecated Buffer constructor
2 parents 66b533d + 3a5c744 commit 1aad91f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/config_test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,9 @@ describe('KubeConfig', () => {
337337

338338
expect(opts).to.deep.equal({
339339
headers: {},
340-
ca: new Buffer('CADATA2', 'utf-8'),
341-
cert: new Buffer('USER_CADATA', 'utf-8'),
342-
key: new Buffer('USER_CKDATA', 'utf-8'),
340+
ca: Buffer.from('CADATA2', 'utf-8'),
341+
cert: Buffer.from('USER_CADATA', 'utf-8'),
342+
key: Buffer.from('USER_CKDATA', 'utf-8'),
343343
rejectUnauthorized: false,
344344
servername: 'kube.example2.com',
345345
});
@@ -357,9 +357,9 @@ describe('KubeConfig', () => {
357357
expect(opts).to.deep.equal({
358358
url: 'https://company.com',
359359
headers: {},
360-
ca: new Buffer('CADATA2', 'utf-8'),
361-
cert: new Buffer('USER_CADATA', 'utf-8'),
362-
key: new Buffer('USER_CKDATA', 'utf-8'),
360+
ca: Buffer.from('CADATA2', 'utf-8'),
361+
cert: Buffer.from('USER_CADATA', 'utf-8'),
362+
key: Buffer.from('USER_CKDATA', 'utf-8'),
363363
rejectUnauthorized: false,
364364
strictSSL: false,
365365
agentOptions: {
@@ -376,9 +376,9 @@ describe('KubeConfig', () => {
376376

377377
expect(opts).to.deep.equal({
378378
headers: {},
379-
ca: new Buffer('CADATA2', 'utf-8'),
380-
cert: new Buffer('USER2_CADATA', 'utf-8'),
381-
key: new Buffer('USER2_CKDATA', 'utf-8'),
379+
ca: Buffer.from('CADATA2', 'utf-8'),
380+
cert: Buffer.from('USER2_CADATA', 'utf-8'),
381+
key: Buffer.from('USER2_CKDATA', 'utf-8'),
382382
rejectUnauthorized: false,
383383
});
384384
});
@@ -393,7 +393,7 @@ describe('KubeConfig', () => {
393393
await kc.applyToRequest(opts);
394394
expect(opts).to.deep.equal({
395395
headers: {},
396-
ca: new Buffer('CADATA2', 'utf-8'),
396+
ca: Buffer.from('CADATA2', 'utf-8'),
397397
auth: {
398398
username: 'foo',
399399
password: 'bar',

0 commit comments

Comments
 (0)