Skip to content

Commit 6a43d9f

Browse files
committed
fix: variable names for reporter for Call
1 parent 20dfa82 commit 6a43d9f

File tree

4 files changed

+29
-29
lines changed

4 files changed

+29
-29
lines changed

src/reporters/console.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,26 @@ const getExpectedString = (ex: Call) => {
2020

2121
class ConsoleReporter implements Reporter {
2222

23-
onBegin(options: IOptions, Calls: Call[]) {}
24-
onTestBegin(options: IOptions, Call: Call) {}
25-
onTestEnd(options: IOptions, Call: Call) {}
26-
onEnd(options: IOptions, Calls: Call[]) {
23+
onBegin(options: IOptions, calls: Call[]) {}
24+
onTestBegin(options: IOptions, call: Call) {}
25+
onTestEnd(options: IOptions, call: Call) {}
26+
onEnd(options: IOptions, calls: Call[]) {
2727
const metrics = {
2828
success: 0,
2929
error: 0
3030
};
31-
_.chain(Calls)
31+
_.chain(calls)
3232
.groupBy("methodName")
33-
.forEach((CallsForMethod, methodName) => {
34-
const hasInvalid = CallsForMethod.reduce((m, {valid}) => m || !valid, false);
33+
.forEach((callsForMethod, methodName) => {
34+
const hasInvalid = callsForMethod.reduce((m, {valid}) => m || !valid, false);
3535

3636
if (hasInvalid) {
3737
console.log(colors.bgRed(colors.yellow(methodName + ":")));
3838
} else {
3939
console.log(colors.bgGreen(colors.black(methodName + ":")));
4040
}
4141

42-
CallsForMethod.forEach((ex) => {
42+
callsForMethod.forEach((ex) => {
4343
if (ex.valid) {
4444
metrics.success++;
4545
const expected = getExpectedString(ex);

src/reporters/emptyReporter.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@ import { Call, IOptions } from '../coverage';
22
import Reporter from './reporter';
33

44
class EmptyReporter implements Reporter {
5-
onBegin(options: IOptions, Calls: Call[]) {
6-
console.log(`Starting the run with ${Calls.length} tests`);
5+
onBegin(options: IOptions, calls: Call[]) {
6+
console.log(`Starting the run with ${calls.length} tests`);
77
}
88

9-
onTestBegin(options: IOptions, Call: Call) {
10-
console.log(`started test ${Call.title}`);
9+
onTestBegin(options: IOptions, call: Call) {
10+
console.log(`started test ${call.title}`);
1111
}
1212

13-
onTestEnd(options: IOptions, Call: Call) {
14-
console.log(`Finished test ${Call.title}: ${Call.valid ? "success" : "error"}`);
13+
onTestEnd(options: IOptions, call: Call) {
14+
console.log(`Finished test ${call.title}: ${call.valid ? "success" : "error"}`);
1515
}
1616

17-
onEnd(options: IOptions, Calls: Call[]) {
18-
const failed = Calls.filter((ec) => !ec.valid);
19-
const passed = Calls.filter((ec) => ec.valid);
20-
console.log(`Finished the running ${Calls.length} tests: ${failed.length} failed, ${passed.length} passed`);
17+
onEnd(options: IOptions, calls: Call[]) {
18+
const failed = calls.filter((ec) => !ec.valid);
19+
const passed = calls.filter((ec) => ec.valid);
20+
console.log(`Finished the running ${calls.length} tests: ${failed.length} failed, ${passed.length} passed`);
2121
}
2222
}
2323

src/reporters/json.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ import { Call, IOptions } from '../coverage';
22
import Reporter from './reporter';
33

44
class JsonReporter implements Reporter {
5-
onBegin(options: IOptions, Calls: Call[]) {}
6-
onTestBegin(options: IOptions, Call: Call) {}
5+
onBegin(options: IOptions, calls: Call[]) {}
6+
onTestBegin(options: IOptions, call: Call) {}
77

8-
onTestEnd(options: IOptions, Call: Call) {}
8+
onTestEnd(options: IOptions, call: Call) {}
99

10-
onEnd(options: IOptions, Calls: Call[]) {
11-
const failed = Calls.filter((ec) => !ec.valid);
10+
onEnd(options: IOptions, calls: Call[]) {
11+
const failed = calls.filter((ec) => !ec.valid);
1212

13-
const passed = Calls.filter((ec) => ec.valid);
13+
const passed = calls.filter((ec) => ec.valid);
1414

15-
console.log(JSON.stringify(Calls, undefined, 4));
15+
console.log(JSON.stringify(calls, undefined, 4));
1616
}
1717
}
1818

src/reporters/reporter.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Call, IOptions } from "../coverage";
22

33
interface Reporter {
4-
onBegin(options: IOptions, Calls: Call[]): void;
5-
onTestBegin(options: IOptions, Call: Call): void;
6-
onTestEnd(options: IOptions, Call: Call): void;
7-
onEnd(options: IOptions, Calls: Call[]): void;
4+
onBegin(options: IOptions, calls: Call[]): void;
5+
onTestBegin(options: IOptions, call: Call): void;
6+
onTestEnd(options: IOptions, call: Call): void;
7+
onEnd(options: IOptions, calls: Call[]): void;
88
}
99

1010
export default Reporter;

0 commit comments

Comments
 (0)