Skip to content
This repository was archived by the owner on Dec 10, 2020. It is now read-only.

Commit 1305892

Browse files
committed
Lint test/net, test/rpc, test/util
1 parent 04bc8ff commit 1305892

File tree

9 files changed

+21
-7
lines changed

9 files changed

+21
-7
lines changed

test/net/peer/peer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint-disable */
2+
// TODO: re-enable linting. Disabled because much of test is commented out
3+
// resulting in unused variable false positives
14
import tape from 'tape-catch'
25
const td = require('testdouble')
36
import { Peer } from '../../../lib/net/peer'

test/net/peer/rlpxpeer.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint-disable */
2+
// TODO: re-enable linting. Disabled because much of test is commented out
3+
// resulting in unused variable false positives
14
import tape from 'tape-catch'
25
const td = require('testdouble')
36
import { EventEmitter } from 'events'

test/net/peerpool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ defaultLogger.silent = true
66

77
tape('[PeerPool]', (t) => {
88
const Peer = td.replace('../../lib/net/peer/peer', function (this: any, id: any) {
9-
this.id = id
9+
this.id = id // eslint-disable-line no-invalid-this
1010
})
1111
const PeerPool = require('../../lib/net/peerpool').PeerPool
1212

test/net/protocol/ethprotocol.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
/* eslint-disable */
2+
// TODO: re-enable linting. Disabled because much of test is commented out
3+
// resulting in unused variable false positives
14
import tape from 'tape-catch'
5+
import { BN } from 'ethereumjs-util'
26
import { Chain } from '../../../lib/blockchain/chain'
37
const { EthProtocol } = require('../../../lib/net/protocol')
48

5-
const BN = require('bn.js')
6-
79
tape('[EthProtocol]', (t) => {
810
t.test('should get properties', (t) => {
911
const p = new EthProtocol({})

test/net/protocol/lesprotocol.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
/* eslint-disable */
2+
// TODO: re-enable linting. Disabled because much of test is commented out
3+
// resulting in unused variable false positives
14
import tape from 'tape-catch'
5+
import { BN } from 'ethereumjs-util'
26
import { Chain } from '../../../lib/blockchain'
37
const { LesProtocol } = require('../../../lib/net/protocol')
4-
const BN = require('bn.js')
58

69
tape('[LesProtocol]', (t) => {
710
t.test('should get properties', (t) => {

test/net/protocol/libp2psender.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import tape from 'tape-catch'
22
const pull = require('pull-stream')
3+
// TODO: investigate pull-pair implicit dependency...
4+
// eslint-disable-next-line implicit-dependencies/no-implicit
35
const DuplexPair = require('pull-pair/duplex')
46
const { Libp2pSender } = require('../../../lib/net/protocol')
57

test/net/protocol/protocol.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import tape from 'tape-catch'
22
const td = require('testdouble')
33
import { EventEmitter } from 'events'
4-
import { Sender } from '../../../lib/net/protocol/sender'
54
import { Protocol } from '../../../lib/net/protocol/protocol'
65

76
tape('[Protocol]', (t) => {
7+
// TODO: remove lint ignores when disabled tests are uncommented
8+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
89
const BoundProtocol = td.replace('../../../lib/net/protocol/boundprotocol')
10+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
911
const Sender = td.replace('../../../lib/net/protocol/sender')
1012
const testMessage = {
1113
name: 'TestMessage',

test/rpc/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export function baseRequest(t: tape.Test, server: any, req: any, expect: any, ex
7777
.send(req)
7878
.expect(expect)
7979
.expect(expectRes)
80-
.end((err: any, res: any) => {
80+
.end((err: any) => {
8181
closeRPC(server)
8282
t.end(err)
8383
})

test/util/parse.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import tape from 'tape-catch'
2-
import * as path from 'path'
32
import { parseBootnodes, parseTransports, parseParams } from '../../lib/util'
43

54
tape('[Util/Parse]', (t) => {

0 commit comments

Comments
 (0)