Skip to content

Commit 9a10bb1

Browse files
committed
style: linting
1 parent 7d3ccd7 commit 9a10bb1

16 files changed

+2995
-1649
lines changed

__tests__/addresses.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ describe('addresses api', () => {
2525
.set({ 'x-wallet-id': TestUtils.walletId });
2626
expect(response.status).toBe(200);
2727
expect(response.body.addresses.length).toBe(gapLimit + 4);
28-
expect(response.body.addresses.slice(0, TestUtils.addresses.length)).toEqual(TestUtils.addresses);
28+
expect(response.body.addresses.slice(0, TestUtils.addresses.length))
29+
.toEqual(TestUtils.addresses);
2930
});
3031
});

__tests__/create-nft.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import TestUtils from './test-utils';
2-
import httpFixtures from './__fixtures__/http-fixtures';
32

43
describe('create-nft api', () => {
54
it('should return 200 with a valid body', async () => {

__tests__/create-token.test.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import TestUtils from './test-utils';
2-
import httpFixtures from './__fixtures__/http-fixtures';
32

43
describe('create-token api', () => {
54
it('should return 200 with a valid body', async () => {

__tests__/integration/multisig.test.js

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,29 @@ describe('send tx (HTR)', () => {
3232
minSignatures: 3,
3333
};
3434

35-
const addresses = [
36-
'wgyUgNjqZ18uYr4YfE2ALW6tP5hd8MumH5',
37-
'wbe2eJdyZVimA7nJjmBQnKYJSXmpnpMKgG',
38-
'wQQWdSZwp2CEGKsTvvbJ7i8HfHuV2i5QVQ',
39-
'wfrtq9cMe1YfixVgSKXQNQ5hjsmR4hpjP6',
40-
'wQG7itjdtZBsNTk9TG4f1HrehyQiAEMN18',
41-
'wfgSqHUHPtmj2GDy8YfasbPPcFh8L1GPMA',
42-
'wgZbCEMHHnhftCAwj7CRBmfi5TgBhfMZbk',
43-
'wdz9NeMac7jyVeP2WK4BJWsM1zpd9tgsBb',
44-
'wPs7WaRCqwC89uHycLbctDGmWPgH9oZvjp',
45-
'wWJJxvr6oSk7WZdE9rpSRMoE6ZqJ3i8VDc',
46-
'wbuDJtmM7vg8at2h5o3pTCHE4SASEFYusr',
47-
'wPNkywbiw8UHbRQkD3nZ3EHMQsjyTamh9u',
48-
'wQBNidXXYpE943BgydUNtarAwNzk612Yip',
49-
'wh2eCGzUK9rLThr5D6tyCfckHpBjS97ERA',
50-
'wZvajxVp3LabcZiY3XPrivrXiSS6wphRu7',
51-
'wgPbL1WzbrEntepHRC92UX6mA2EmaqfDqt',
52-
'wbdx4g3rucX3WHmZRXjPEKtRfZ7XSnCGKf',
53-
'wiKTnqSN11ukuCWEXRVrRTTPo2mw4fGue3',
54-
'wQ4aQP4YqJqfwshLggR2w1Gg3UFhhKhVKs',
55-
'wca2xk9S2MVn2UrKh78UScdwXz3xrTp8Ky',
56-
'wcUZ6J7t2B1s8bqRYiyuZAftcdCGRSiiau',
57-
];
35+
// const addresses = [
36+
// 'wgyUgNjqZ18uYr4YfE2ALW6tP5hd8MumH5',
37+
// 'wbe2eJdyZVimA7nJjmBQnKYJSXmpnpMKgG',
38+
// 'wQQWdSZwp2CEGKsTvvbJ7i8HfHuV2i5QVQ',
39+
// 'wfrtq9cMe1YfixVgSKXQNQ5hjsmR4hpjP6',
40+
// 'wQG7itjdtZBsNTk9TG4f1HrehyQiAEMN18',
41+
// 'wfgSqHUHPtmj2GDy8YfasbPPcFh8L1GPMA',
42+
// 'wgZbCEMHHnhftCAwj7CRBmfi5TgBhfMZbk',
43+
// 'wdz9NeMac7jyVeP2WK4BJWsM1zpd9tgsBb',
44+
// 'wPs7WaRCqwC89uHycLbctDGmWPgH9oZvjp',
45+
// 'wWJJxvr6oSk7WZdE9rpSRMoE6ZqJ3i8VDc',
46+
// 'wbuDJtmM7vg8at2h5o3pTCHE4SASEFYusr',
47+
// 'wPNkywbiw8UHbRQkD3nZ3EHMQsjyTamh9u',
48+
// 'wQBNidXXYpE943BgydUNtarAwNzk612Yip',
49+
// 'wh2eCGzUK9rLThr5D6tyCfckHpBjS97ERA',
50+
// 'wZvajxVp3LabcZiY3XPrivrXiSS6wphRu7',
51+
// 'wgPbL1WzbrEntepHRC92UX6mA2EmaqfDqt',
52+
// 'wbdx4g3rucX3WHmZRXjPEKtRfZ7XSnCGKf',
53+
// 'wiKTnqSN11ukuCWEXRVrRTTPo2mw4fGue3',
54+
// 'wQ4aQP4YqJqfwshLggR2w1Gg3UFhhKhVKs',
55+
// 'wca2xk9S2MVn2UrKh78UScdwXz3xrTp8Ky',
56+
// 'wcUZ6J7t2B1s8bqRYiyuZAftcdCGRSiiau',
57+
// ];
5858

5959
const fundTx1 = {
6060
txId: null,
@@ -79,7 +79,7 @@ describe('send tx (HTR)', () => {
7979
'multisig-extra': {
8080
pubkeys,
8181
total: 5,
82-
minSignatures: 2, // Having a different minSignatures will make this be another wallet completely
82+
minSignatures: 2, // Having a different minSignatures will change the wallet completely
8383
},
8484
};
8585
try {
@@ -226,6 +226,7 @@ describe('send tx (HTR)', () => {
226226

227227
// Change sig3 to be invalid
228228
const p2shSig = hathorLib.P2SHSignature.deserialize(sig3);
229+
// eslint-disable-next-line no-unused-vars
229230
for (const [index, sig] of Object.entries(p2shSig.signatures)) {
230231
const buf = Buffer.from(sig, 'hex');
231232
for (let i = 0; i < buf.length; i++) {

__tests__/melt-tokens.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ describe('melt-tokens api', () => {
9999

100100
// Mimic the full node wallet:address_history message
101101
TestUtils.socket.send(JSON.stringify(wsFixtures.melt));
102-
await new Promise(resolve => setTimeout(resolve, 2000));
102+
await new Promise(resolve => {
103+
setTimeout(resolve, 2000);
104+
});
103105

104106
// Check the balance
105107
response = await TestUtils.request

__tests__/test-utils.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import supertest from 'supertest';
2+
// eslint-disable-next-line import/no-extraneous-dependencies
23
import axios from 'axios';
34
import MockAdapter from 'axios-mock-adapter';
45
import { Server } from 'mock-socket';
@@ -127,7 +128,9 @@ class TestUtils {
127128
if (res.body && res.body.success !== false) {
128129
break;
129130
}
130-
await new Promise(resolve => setTimeout(resolve, 500));
131+
await new Promise(resolve => {
132+
setTimeout(resolve, 500);
133+
});
131134
}
132135
}
133136

@@ -168,7 +171,9 @@ class TestUtils {
168171

169172
static stopMocks() {
170173
httpMock.reset();
171-
return new Promise(resolve => wsMock.stop(resolve));
174+
return new Promise(resolve => {
175+
wsMock.stop(resolve);
176+
});
172177
}
173178

174179
static reorderHandlers() {

jest-integration.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ module.exports = {
66
collectCoverageFrom: ['<rootDir>/src/**/*.js'],
77
testMatch: ['<rootDir>/__tests__/integration/**/*.test.js'],
88
coverageReporters: ['text-summary', 'lcov', 'clover'],
9-
testTimeout: 20 * 60 * 1000, // 20 minutes seems reasonable for slow integration tests. May be adjusted with optimizations
9+
testTimeout: 20 * 60 * 1000, // May be adjusted with optimizations
1010
setupFilesAfterEnv: ['<rootDir>/setupTests-integration.js'],
1111
};

0 commit comments

Comments
 (0)