Skip to content

Commit aa101c8

Browse files
committed
format code
1 parent 4d147c4 commit aa101c8

File tree

7 files changed

+224
-234
lines changed

7 files changed

+224
-234
lines changed

typescript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
"vite": "^6.3.5",
2020
"vitest": "^3.1.4"
2121
}
22-
}
22+
}

typescript/src/application.test.ts

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class TestContext {
1515
await new Promise<void>((resolve) =>
1616
this.output.once('readable', () => {
1717
if (expectation()) resolve();
18-
})
18+
}),
1919
);
2020
}
2121

@@ -34,7 +34,6 @@ class TestContext {
3434

3535
sendCommand(command: string) {
3636
this.expectations.push(() => {
37-
3837
const prompt = this.output.read(2)?.toString();
3938
expect(prompt).toBe('> ');
4039
this.input.write(`${command}\n`);
@@ -49,46 +48,41 @@ describe('TaskList Application', () => {
4948

5049
ctx.sendCommand('show');
5150

52-
ctx.sendCommand("add project secrets");
53-
ctx.sendCommand("add task secrets Eat more donuts.");
54-
ctx.sendCommand("add task secrets Destroy all humans.");
51+
ctx.sendCommand('add project secrets');
52+
ctx.sendCommand('add task secrets Eat more donuts.');
53+
ctx.sendCommand('add task secrets Destroy all humans.');
5554

56-
ctx.sendCommand("show");
57-
ctx.expectOutput([
58-
"secrets",
59-
" [ ] 1: Eat more donuts.",
60-
" [ ] 2: Destroy all humans.",
61-
"",
62-
]);
55+
ctx.sendCommand('show');
56+
ctx.expectOutput(['secrets', ' [ ] 1: Eat more donuts.', ' [ ] 2: Destroy all humans.', '']);
6357

64-
ctx.sendCommand("add project training");
65-
ctx.sendCommand("add task training Four Elements of Simple Design");
66-
ctx.sendCommand("add task training SOLID");
67-
ctx.sendCommand("add task training Coupling and Cohesion");
68-
ctx.sendCommand("add task training Primitive Obsession");
69-
ctx.sendCommand("add task training Outside-In TDD");
70-
ctx.sendCommand("add task training Interaction-Driven Design");
58+
ctx.sendCommand('add project training');
59+
ctx.sendCommand('add task training Four Elements of Simple Design');
60+
ctx.sendCommand('add task training SOLID');
61+
ctx.sendCommand('add task training Coupling and Cohesion');
62+
ctx.sendCommand('add task training Primitive Obsession');
63+
ctx.sendCommand('add task training Outside-In TDD');
64+
ctx.sendCommand('add task training Interaction-Driven Design');
7165

72-
ctx.sendCommand("check 1");
73-
ctx.sendCommand("check 3");
74-
ctx.sendCommand("check 5");
75-
ctx.sendCommand("check 6");
66+
ctx.sendCommand('check 1');
67+
ctx.sendCommand('check 3');
68+
ctx.sendCommand('check 5');
69+
ctx.sendCommand('check 6');
7670

77-
ctx.sendCommand("show");
78-
ctx.expectOutput(
79-
["secrets",
80-
" [x] 1: Eat more donuts.",
81-
" [ ] 2: Destroy all humans.",
82-
"",
83-
"training",
84-
" [x] 3: Four Elements of Simple Design",
85-
" [ ] 4: SOLID",
86-
" [x] 5: Coupling and Cohesion",
87-
" [x] 6: Primitive Obsession",
88-
" [ ] 7: Outside-In TDD",
89-
" [ ] 8: Interaction-Driven Design",
90-
""
91-
]);
71+
ctx.sendCommand('show');
72+
ctx.expectOutput([
73+
'secrets',
74+
' [x] 1: Eat more donuts.',
75+
' [ ] 2: Destroy all humans.',
76+
'',
77+
'training',
78+
' [x] 3: Four Elements of Simple Design',
79+
' [ ] 4: SOLID',
80+
' [x] 5: Coupling and Cohesion',
81+
' [x] 6: Primitive Obsession',
82+
' [ ] 7: Outside-In TDD',
83+
' [ ] 8: Interaction-Driven Design',
84+
'',
85+
]);
9286
ctx.sendCommand('quit');
9387

9488
await ctx.run();

typescript/src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { TaskList } from "./task_list";
1+
import { TaskList } from './task_list';
22

3-
new TaskList(process.stdin, process.stdout).run()
3+
new TaskList(process.stdin, process.stdout).run();

typescript/src/task.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
1-
21
export class Task {
3-
constructor(private _id: number, private _description: string, private _done: boolean) { }
2+
constructor(
3+
private _id: number,
4+
private _description: string,
5+
private _done: boolean,
6+
) {}
47

5-
get id() {
6-
return this._id;
7-
}
8+
get id() {
9+
return this._id;
10+
}
811

9-
get description() {
10-
return this._description;
11-
}
12+
get description() {
13+
return this._description;
14+
}
1215

13-
get done() {
14-
return this._done;
15-
}
16+
get done() {
17+
return this._done;
18+
}
1619

17-
set done(val: boolean) {
18-
this._done = val;
19-
}
20+
set done(val: boolean) {
21+
this._done = val;
22+
}
2023
}
21-

0 commit comments

Comments
 (0)