Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: replace use of deprecated Buffer constructor #1891

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/config_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,9 +337,9 @@ describe('KubeConfig', () => {

expect(opts).to.deep.equal({
headers: {},
ca: new Buffer('CADATA2', 'utf-8'),
cert: new Buffer('USER_CADATA', 'utf-8'),
key: new Buffer('USER_CKDATA', 'utf-8'),
ca: Buffer.from('CADATA2', 'utf-8'),
cert: Buffer.from('USER_CADATA', 'utf-8'),
key: Buffer.from('USER_CKDATA', 'utf-8'),
rejectUnauthorized: false,
servername: 'kube.example2.com',
});
Expand All @@ -357,9 +357,9 @@ describe('KubeConfig', () => {
expect(opts).to.deep.equal({
url: 'https://company.com',
headers: {},
ca: new Buffer('CADATA2', 'utf-8'),
cert: new Buffer('USER_CADATA', 'utf-8'),
key: new Buffer('USER_CKDATA', 'utf-8'),
ca: Buffer.from('CADATA2', 'utf-8'),
cert: Buffer.from('USER_CADATA', 'utf-8'),
key: Buffer.from('USER_CKDATA', 'utf-8'),
rejectUnauthorized: false,
strictSSL: false,
agentOptions: {
Expand All @@ -376,9 +376,9 @@ describe('KubeConfig', () => {

expect(opts).to.deep.equal({
headers: {},
ca: new Buffer('CADATA2', 'utf-8'),
cert: new Buffer('USER2_CADATA', 'utf-8'),
key: new Buffer('USER2_CKDATA', 'utf-8'),
ca: Buffer.from('CADATA2', 'utf-8'),
cert: Buffer.from('USER2_CADATA', 'utf-8'),
key: Buffer.from('USER2_CKDATA', 'utf-8'),
rejectUnauthorized: false,
});
});
Expand All @@ -393,7 +393,7 @@ describe('KubeConfig', () => {
await kc.applyToRequest(opts);
expect(opts).to.deep.equal({
headers: {},
ca: new Buffer('CADATA2', 'utf-8'),
ca: Buffer.from('CADATA2', 'utf-8'),
auth: {
username: 'foo',
password: 'bar',
Expand Down