Skip to content

Commit c304c77

Browse files
patinthehatPatrick
authored andcommitted
convert to typescript
1 parent febe344 commit c304c77

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

tests/TestClasses/FakeClient.js renamed to tests/TestClasses/FakeClient.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { sep } from 'path';
22

33
class Client {
4+
public portNumber: number;
5+
public host: string;
6+
47
constructor(portNumber = 23517, host = 'localhost') {
58
this.portNumber = portNumber;
69

@@ -9,13 +12,13 @@ class Client {
912
}
1013

1114
export class FakeClient extends Client {
12-
sentRequests = [];
15+
public sentRequests: any[] = [];
1316

14-
async send(request) {
15-
const requestProperties = request.toArray();
17+
async send(request: any) {
18+
const requestProperties: any = request.toArray();
1619
const payloads = request.payloads;
1720

18-
payloads.map(payload => {
21+
payloads.map((payload: any) => {
1922
payload.toArray();
2023

2124
const fn = payload.data.origin.file ?? '/test/file.js';
@@ -47,7 +50,7 @@ export class FakeClient extends Client {
4750
}
4851

4952
// eslint-disable-next-line no-unused-vars
50-
async lockExists(lockName) {
53+
async lockExists(lockName: any) {
5154
return new Promise(resolve => {
5255
resolve({ active: false, stop_exectution: true });
5356
});
@@ -67,7 +70,7 @@ export class FakeClient extends Client {
6770
return __dirname.replace('/tests/TestClasses', '');
6871
}
6972

70-
convertToUnixPath(path) {
73+
convertToUnixPath(path: string) {
7174
path = path.replace('D:\\a\\ray\\ray', '');
7275

7376
return path.replace(sep, '/');

0 commit comments

Comments
 (0)