Skip to content

Commit 774aed1

Browse files
authored
Apply suggestions from code review
1 parent b1ff004 commit 774aed1

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

test/client.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
2+
23
const metatests = require('metatests');
34
const { Metacom } = require('metacom/lib/client');
5+
46
let token = '';
57

68
const connect = async () => {
@@ -21,7 +23,6 @@ const connect = async () => {
2123
if (typeof signin !== 'object' || signin?.status !== 'logged')
2224
return console.log('Not logged');
2325
token = signin?.token;
24-
// console.log(signin);
2526
runTests(client);
2627
};
2728

@@ -34,7 +35,6 @@ const runTests = (client) => {
3435
'files',
3536
'test',
3637
]);
37-
// console.log(introspect);
3838
test.strictSame(introspect?.auth?.restore?.[0], 'token');
3939
test.end();
4040
});
@@ -49,7 +49,6 @@ const runTests = (client) => {
4949
const cities = await client.socketCall('example')('citiesByCountry')({
5050
countryId: 1,
5151
});
52-
// console.log(cities);
5352
test.strictEqual(cities?.result, 'success');
5453
test.strictEqual(Array.isArray(cities?.data), true);
5554
test.end();
@@ -58,7 +57,6 @@ const runTests = (client) => {
5857
metatests.testAsync('example/customError', async (test) => {
5958
try {
6059
await client.socketCall('example')('customError')();
61-
6260
} catch (customError) {
6361
test.errorCompare(customError, new Error('Return custom error', 12345));
6462
test.strictEqual(customError?.code, 12345);
@@ -101,11 +99,9 @@ const runTests = (client) => {
10199
metatests.testAsync('example/getClientInfo', async (test) => {
102100
try {
103101
const info = await client.socketCall('example')('getClientInfo')();
104-
// console.log(info);
105102
test.strictEqual(info?.result?.ip, '127.0.0.1');
106103
test.strictEqual(info?.result?.token, token);
107104
test.strictEqual(info?.result?.accountId, '2');
108-
109105
} catch (Error) {
110106
console.log(Error);
111107
} finally {
@@ -150,8 +146,6 @@ const runTests = (client) => {
150146
test.end();
151147
}
152148
});
153-
154-
// process.exit();
155149
};
156150

157151
connect();

0 commit comments

Comments
 (0)