Skip to content

Commit c0fd8e0

Browse files
committed
update to test
1 parent 152e90f commit c0fd8e0

28 files changed

+141
-8
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const { createSecureContext: customCreateCredentials } = require('node:tls');
2+
3+
const credentials = customCreateCredentials({
4+
key: privateKey,
5+
cert: certificate,
6+
ca: [caCertificate]
7+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { createSecureContext as customCreateCredentials } from 'node:tls';
2+
3+
const credentials = customCreateCredentials({
4+
key: privateKey,
5+
cert: certificate,
6+
ca: [caCertificate]
7+
});

recipes/createCredentials-to-createSecureContext/tests/expected/file-1.js renamed to recipes/createCredentials-to-createSecureContext/tests/expected/file-1.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ const credentials = createSecureContext({
44
key: privateKey,
55
cert: certificate,
66
ca: [caCertificate]
7-
});
7+
});
File renamed without changes.

recipes/createCredentials-to-createSecureContext/tests/expected/file-2.js renamed to recipes/createCredentials-to-createSecureContext/tests/expected/file-2.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ const tls = require('node:tls');
33
const credentials = tls.createSecureContext({
44
key: fs.readFileSync('server-key.pem'),
55
cert: fs.readFileSync('server-cert.pem')
6-
});
6+
});
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import * as tls from 'node:tls';
2+
3+
const credentials = tls.createSecureContext({
4+
key: fs.readFileSync('server-key.pem'),
5+
cert: fs.readFileSync('server-cert.pem')
6+
});
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const { createHash } = require('node:crypto');
2+
const { createSecureContext: customCreateCredentials } = require('node:tls');
3+
4+
const credentials = customCreateCredentials({
5+
key: privateKey,
6+
cert: certificate
7+
});
8+
9+
const hash = createHash('sha256');
10+
hash.update('some data');
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { createHash } from 'node:crypto';
2+
import { createSecureContext as customCreateCredentials } from 'node:tls';
3+
4+
const credentials = customCreateCredentials({
5+
key: privateKey,
6+
cert: certificate
7+
});
8+
9+
const hash = createHash('sha256');
10+
hash.update('some data');

recipes/createCredentials-to-createSecureContext/tests/expected/file-3.js renamed to recipes/createCredentials-to-createSecureContext/tests/expected/file-3.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ const credentials = createSecureContext({
77
});
88

99
const hash = createHash('sha256');
10-
hash.update('some data');
10+
hash.update('some data');
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { createHash } from 'node:crypto';
2+
import { createSecureContext } from 'node:tls';
3+
4+
const credentials = createSecureContext({
5+
key: privateKey,
6+
cert: certificate
7+
});
8+
9+
const hash = createHash('sha256');
10+
hash.update('some data');

0 commit comments

Comments
 (0)