Skip to content

Commit ff2e533

Browse files
committed
tests: general clean up of tests
[ci skip]
1 parent 95af5f1 commit ff2e533

File tree

6 files changed

+783
-782
lines changed

6 files changed

+783
-782
lines changed

src/QUICServer.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,25 @@ import type {
55
Port,
66
PromiseDeconstructed,
77
RemoteInfo,
8+
StreamCodeToReason,
9+
StreamReasonToCode,
810
} from './types';
911
import type { Header } from './native/types';
1012
import type QUICConnectionMap from './QUICConnectionMap';
1113
import type { QUICConfig, TlsConfig } from './config';
12-
import type { StreamCodeToReason, StreamReasonToCode } from './types';
1314
import type { QUICServerConnectionEvent } from './events';
1415
import Logger from '@matrixai/logger';
1516
import { running } from '@matrixai/async-init';
16-
import { StartStop, ready } from '@matrixai/async-init/dist/StartStop';
17+
import { ready, StartStop } from '@matrixai/async-init/dist/StartStop';
18+
import * as events from './events';
19+
import { serverDefault } from './config';
1720
import QUICConnectionId from './QUICConnectionId';
1821
import QUICConnection from './QUICConnection';
1922
import { quiche } from './native';
20-
import { serverDefault } from './config';
21-
import * as events from './events';
2223
import * as utils from './utils';
24+
import { promise } from './utils';
2325
import * as errors from './errors';
2426
import QUICSocket from './QUICSocket';
25-
import { promise } from './utils';
2627

2728
/**
2829
* You must provide a error handler `addEventListener('error')`.
@@ -417,8 +418,7 @@ class QUICServer extends EventTarget {
417418
sig: msgSig.toString('base64url'),
418419
};
419420
const tokenJSON = JSON.stringify(tokenData);
420-
const tokenBuffer = Buffer.from(tokenJSON);
421-
return tokenBuffer;
421+
return Buffer.from(tokenJSON);
422422
}
423423

424424
/**

src/bin/server.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import { webcrypto } from 'crypto';
77
import Logger from '@matrixai/logger';
88
import QUICServer from '../QUICServer';
99

10-
async function main(argv = process.argv): Promise<number> {
11-
argv = argv.slice(2); // Removing prepended file paths
10+
async function main(_argv = process.argv): Promise<number> {
11+
_argv = _argv.slice(2); // Removing prepended file paths
1212

1313
const cryptoKey = await webcrypto.subtle.generateKey(
1414
{
@@ -47,6 +47,7 @@ async function main(argv = process.argv): Promise<number> {
4747
const server = new QUICServer({
4848
crypto,
4949
logger: logger.getChild(QUICServer.name),
50+
config: {},
5051
});
5152

5253
await server.start({

src/events.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,18 @@ class QUICConnectionErrorEvent extends Event {
8989
}
9090
}
9191

92-
class QUICStreamReadableEvent extends Event {
93-
constructor(options?: EventInit) {
94-
super('readable', options);
95-
}
96-
}
97-
98-
class QUICStreamWritableEvent extends Event {
99-
constructor(options?: EventInit) {
100-
super('writable', options);
101-
}
102-
}
92+
// TODO: use these or remove them
93+
// class QUICStreamReadableEvent extends Event {
94+
// constructor(options?: EventInit) {
95+
// super('readable', options);
96+
// }
97+
// }
98+
//
99+
// class QUICStreamWritableEvent extends Event {
100+
// constructor(options?: EventInit) {
101+
// super('writable', options);
102+
// }
103+
// }
103104

104105
class QUICStreamDestroyEvent extends Event {
105106
constructor(options?: EventInit) {

0 commit comments

Comments
 (0)