Skip to content

Commit 798014b

Browse files
committed
lint: fixing up linting errors
[ci skip]
1 parent 85b0375 commit 798014b

7 files changed

+212
-434
lines changed

tests/QUICServer.test.ts

+1-18
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
11
import type { X509Certificate } from '@peculiar/x509';
2-
import type {
3-
QUICConfig,
4-
Host,
5-
Hostname,
6-
Port,
7-
ClientCrypto,
8-
ServerCrypto,
9-
} from '@/types';
10-
import dgram from 'dgram';
2+
import type { Host, Hostname, ServerCrypto } from '@/types';
113
import Logger, { LogLevel, StreamHandler, formatting } from '@matrixai/logger';
124
import QUICServer from '@/QUICServer';
13-
import QUICConnectionId from '@/QUICConnectionId';
14-
import QUICConnection from '@/QUICConnection';
15-
import QUICSocket from '@/QUICSocket';
16-
import { clientDefault, buildQuicheConfig } from '@/config';
17-
import { quiche } from '@/native';
185
import * as utils from '@/utils';
196
import * as testsUtils from './utils';
207

@@ -84,14 +71,10 @@ describe(QUICServer.name, () => {
8471
certEd25519PEM = testsUtils.certToPEM(certEd25519);
8572
});
8673
// This has to be setup asynchronously due to key generation
87-
let clientCrypto: ClientCrypto;
8874
let serverCrypto: ServerCrypto;
8975
let key: ArrayBuffer;
9076
beforeEach(async () => {
9177
key = await testsUtils.generateKeyHMAC();
92-
clientCrypto = {
93-
randomBytes: testsUtils.randomBytes,
94-
};
9578
serverCrypto = {
9679
sign: testsUtils.signHMAC,
9780
verify: testsUtils.verifyHMAC,

tests/QUICStream.test.ts

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import * as utils from '@/utils';
88
import QUICServer from '@/QUICServer';
99
import QUICClient from '@/QUICClient';
1010
import QUICStream from '@/QUICStream';
11-
import { tlsConfigWithCaArb, tlsConfigWithCaGENOKPArb } from './tlsUtils';
1211
import * as testsUtils from './utils';
1312

1413
describe(QUICStream.name, () => {

tests/native/quiche.connection.lifecycle.test.ts

+49-43
Large diffs are not rendered by default.

tests/native/quiche.stream.lifecycle.test.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import type { Connection, StreamIter } from '@/native';
22
import type { ClientCrypto, Host, Port, ServerCrypto } from '@';
3-
import { Host as HostPort, quiche } from '@/native';
3+
import { quiche } from '@/native';
44
import QUICConnectionId from '@/QUICConnectionId';
5-
import { QUICConfig } from '@';
65
import { buildQuicheConfig, clientDefault, serverDefault } from '@/config';
76
import * as utils from '@/utils';
87
import * as testsUtils from '../utils';
@@ -31,10 +30,10 @@ function iterToArray(iter: StreamIter) {
3130
* Does all the steps for initiating a stream on both sides.
3231
* Used as a starting point for a bunch of tests.
3332
*/
34-
function initStreamState(
33+
function _initStreamState(
3534
connectionSource: Connection,
3635
connectionDestination: Connection,
37-
streamId: number,
36+
_streamId: number,
3837
) {
3938
const message = Buffer.from('Message');
4039
connectionSource.streamSend(0, message, false);
@@ -100,7 +99,7 @@ describe('quiche stream lifecycle', () => {
10099
);
101100

102101
const clientBuffer = Buffer.allocUnsafe(quiche.MAX_DATAGRAM_SIZE);
103-
let [clientSendLength, clientSendInfo] = clientConn.send(clientBuffer);
102+
const [clientSendLength] = clientConn.send(clientBuffer);
104103
const clientHeaderInitial = quiche.Header.fromSlice(
105104
clientBuffer.subarray(0, clientSendLength),
106105
quiche.MAX_CONN_ID_LEN,
@@ -133,7 +132,7 @@ describe('quiche stream lifecycle', () => {
133132
});
134133

135134
// Client will retry the initial packet with the token
136-
[clientSendLength, clientSendInfo] = clientConn.send(clientBuffer);
135+
[clientSendLength] = clientConn.send(clientBuffer);
137136

138137
// Server accept
139138
serverConn = quiche.Connection.accept(

tests/native/quiche.test.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import * as testsUtils from '../utils';
33

44
describe('quiche', () => {
55
test('frame parsing', async () => {
6-
let frame: Buffer;
7-
frame = Buffer.from('hello world');
6+
const frame = Buffer.from('hello world');
87
expect(() =>
98
quiche.Header.fromSlice(frame, quiche.MAX_CONN_ID_LEN),
109
).toThrow('BufferTooShort');

0 commit comments

Comments
 (0)