Passed
Branch feature/first-draft (480f87)
by Pieter Epeüs
03:34
created

TestFetcher.create   A

Complexity

Conditions 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 7
c 0
b 0
f 0
ccs 4
cts 4
cp 1
rs 10
cc 1
crap 1
1
import Fetcher from '../fetcher.js'
2
3
export default class TestFetcher extends Fetcher {
4
  async get ({ url, path, searchParams }) {
0 ignored issues
show
Unused Code introduced by
The parameter searchParams is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
The parameter path is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
5 3
    this.log(`Call a request to ${url}`)
6 3
    return 42
7
  }
8
9
  static create ({ fetch, logger }) {
10 4
    const fetcher = new TestFetcher()
11 4
    fetcher.setFetch(fetch)
12 4
    fetcher.setLogger(logger)
13
14 3
    return fetcher
15
  }
16
}
17