@@ -15,7 +15,7 @@ class TestContext {
15
15
await new Promise < void > ( ( resolve ) =>
16
16
this . output . once ( 'readable' , ( ) => {
17
17
if ( expectation ( ) ) resolve ( ) ;
18
- } )
18
+ } ) ,
19
19
) ;
20
20
}
21
21
@@ -34,7 +34,6 @@ class TestContext {
34
34
35
35
sendCommand ( command : string ) {
36
36
this . expectations . push ( ( ) => {
37
-
38
37
const prompt = this . output . read ( 2 ) ?. toString ( ) ;
39
38
expect ( prompt ) . toBe ( '> ' ) ;
40
39
this . input . write ( `${ command } \n` ) ;
@@ -49,46 +48,41 @@ describe('TaskList Application', () => {
49
48
50
49
ctx . sendCommand ( 'show' ) ;
51
50
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.' ) ;
55
54
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.' , '' ] ) ;
63
57
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' ) ;
71
65
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' ) ;
76
70
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
+ ] ) ;
92
86
ctx . sendCommand ( 'quit' ) ;
93
87
94
88
await ctx . run ( ) ;
0 commit comments