@@ -69,7 +69,7 @@ suite('Terminal - Code Execution Manager', () => {
69
69
serviceContainer . setup ( s => s . get ( TypeMoq . It . isValue ( ICodeExecutionHelper ) ) ) . returns ( ( ) => helper . object ) ;
70
70
71
71
await commandHandler ! ( ) ;
72
- helper . verify ( async h => await h . getFileToExecute ( ) , TypeMoq . Times . once ( ) ) ;
72
+ helper . verify ( async h => h . getFileToExecute ( ) , TypeMoq . Times . once ( ) ) ;
73
73
} ) ;
74
74
75
75
test ( 'Ensure executeFileInterTerminal will use provided file' , async ( ) => {
@@ -96,8 +96,8 @@ suite('Terminal - Code Execution Manager', () => {
96
96
97
97
const fileToExecute = Uri . file ( 'x' ) ;
98
98
await commandHandler ! ( fileToExecute ) ;
99
- helper . verify ( async h => await h . getFileToExecute ( ) , TypeMoq . Times . never ( ) ) ;
100
- executionService . verify ( async e => await e . executeFile ( TypeMoq . It . isValue ( fileToExecute ) ) , TypeMoq . Times . once ( ) ) ;
99
+ helper . verify ( async h => h . getFileToExecute ( ) , TypeMoq . Times . never ( ) ) ;
100
+ executionService . verify ( async e => e . executeFile ( TypeMoq . It . isValue ( fileToExecute ) ) , TypeMoq . Times . once ( ) ) ;
101
101
} ) ;
102
102
103
103
test ( 'Ensure executeFileInterTerminal will use active file' , async ( ) => {
@@ -119,12 +119,12 @@ suite('Terminal - Code Execution Manager', () => {
119
119
const fileToExecute = Uri . file ( 'x' ) ;
120
120
const helper = TypeMoq . Mock . ofType < ICodeExecutionHelper > ( ) ;
121
121
serviceContainer . setup ( s => s . get ( TypeMoq . It . isValue ( ICodeExecutionHelper ) ) ) . returns ( ( ) => helper . object ) ;
122
- helper . setup ( async h => await h . getFileToExecute ( ) ) . returns ( ( ) => Promise . resolve ( fileToExecute ) ) ;
122
+ helper . setup ( async h => h . getFileToExecute ( ) ) . returns ( ( ) => Promise . resolve ( fileToExecute ) ) ;
123
123
const executionService = TypeMoq . Mock . ofType < ICodeExecutionService > ( ) ;
124
124
serviceContainer . setup ( s => s . get ( TypeMoq . It . isValue ( ICodeExecutionService ) , TypeMoq . It . isValue ( 'standard' ) ) ) . returns ( ( ) => executionService . object ) ;
125
125
126
126
await commandHandler ! ( fileToExecute ) ;
127
- executionService . verify ( async e => await e . executeFile ( TypeMoq . It . isValue ( fileToExecute ) ) , TypeMoq . Times . once ( ) ) ;
127
+ executionService . verify ( async e => e . executeFile ( TypeMoq . It . isValue ( fileToExecute ) ) , TypeMoq . Times . once ( ) ) ;
128
128
} ) ;
129
129
130
130
async function testExecutionOfSelectionWithoutAnyActiveDocument ( commandId : string , executionSericeId : string ) {
@@ -150,7 +150,7 @@ suite('Terminal - Code Execution Manager', () => {
150
150
documentManager . setup ( d => d . activeTextEditor ) . returns ( ( ) => undefined ) ;
151
151
152
152
await commandHandler ! ( ) ;
153
- executionService . verify ( async e => await e . execute ( TypeMoq . It . isAny ( ) ) , TypeMoq . Times . never ( ) ) ;
153
+ executionService . verify ( async e => e . execute ( TypeMoq . It . isAny ( ) ) , TypeMoq . Times . never ( ) ) ;
154
154
}
155
155
156
156
test ( 'Ensure executeSelectionInTerminal will do nothing if theres no active document' , async ( ) => {
@@ -186,7 +186,7 @@ suite('Terminal - Code Execution Manager', () => {
186
186
documentManager . setup ( d => d . activeTextEditor ) . returns ( ( ) => { return { } as any ; } ) ;
187
187
188
188
await commandHandler ! ( ) ;
189
- executionService . verify ( async e => await e . execute ( TypeMoq . It . isAny ( ) ) , TypeMoq . Times . never ( ) ) ;
189
+ executionService . verify ( async e => e . execute ( TypeMoq . It . isAny ( ) ) , TypeMoq . Times . never ( ) ) ;
190
190
}
191
191
192
192
test ( 'Ensure executeSelectionInTerminal will do nothing if no text is selected' , async ( ) => {
@@ -218,7 +218,7 @@ suite('Terminal - Code Execution Manager', () => {
218
218
const helper = TypeMoq . Mock . ofType < ICodeExecutionHelper > ( ) ;
219
219
serviceContainer . setup ( s => s . get ( TypeMoq . It . isValue ( ICodeExecutionHelper ) ) ) . returns ( ( ) => helper . object ) ;
220
220
helper . setup ( h => h . getSelectedTextToExecute ) . returns ( ( ) => ( ) => Promise . resolve ( textSelected ) ) ;
221
- helper . setup ( h => h . normalizeLines ) . returns ( ( ) => ( ) => textSelected ) ;
221
+ helper . setup ( h => h . normalizeLines ) . returns ( ( ) => ( ) => Promise . resolve ( textSelected ) ) . verifiable ( TypeMoq . Times . once ( ) ) ;
222
222
const executionService = TypeMoq . Mock . ofType < ICodeExecutionService > ( ) ;
223
223
serviceContainer . setup ( s => s . get ( TypeMoq . It . isValue ( ICodeExecutionService ) , TypeMoq . It . isValue ( executionServiceId ) ) ) . returns ( ( ) => executionService . object ) ;
224
224
const document = TypeMoq . Mock . ofType < TextDocument > ( ) ;
@@ -228,7 +228,8 @@ suite('Terminal - Code Execution Manager', () => {
228
228
documentManager . setup ( d => d . activeTextEditor ) . returns ( ( ) => activeEditor . object ) ;
229
229
230
230
await commandHandler ! ( ) ;
231
- executionService . verify ( async e => await e . execute ( TypeMoq . It . isValue ( textSelected ) , TypeMoq . It . isValue ( activeDocumentUri ) ) , TypeMoq . Times . once ( ) ) ;
231
+ executionService . verify ( async e => e . execute ( TypeMoq . It . isValue ( textSelected ) , TypeMoq . It . isValue ( activeDocumentUri ) ) , TypeMoq . Times . once ( ) ) ;
232
+ helper . verifyAll ( ) ;
232
233
}
233
234
test ( 'Ensure executeSelectionInTerminal will normalize selected text and send it to the terminal' , async ( ) => {
234
235
await testExecutionOfSelectionIsSentToTerminal ( Commands . Exec_Selection_In_Terminal , 'standard' ) ;
0 commit comments