15
15
* limitations under the License.
16
16
*/
17
17
18
- import { BottomBarPanel , MarkerType , OutputView , ProblemsView , TerminalView , VSBrowser } from 'vscode-extension-tester' ;
18
+ import { BottomBarPanel , EditorView , MarkerType , OutputView , ProblemsView , TerminalView , VSBrowser } from 'vscode-extension-tester' ;
19
19
import * as path from 'path' ;
20
20
import { expect } from 'chai' ;
21
21
@@ -65,6 +65,10 @@ describe('Bottom Bar Example Tests', function () {
65
65
} , 15000 ) ;
66
66
} ) ;
67
67
68
+ after ( async function ( ) {
69
+ await new EditorView ( ) . closeAllEditors ( ) ;
70
+ } ) ;
71
+
68
72
// These tests use getAllVisibleMarkers() and are unreliable and should not be included.
69
73
//
70
74
// now we can look at the error markers
@@ -136,8 +140,7 @@ describe('Bottom Bar Example Tests', function () {
136
140
} ) ;
137
141
138
142
// lets test the output view now
139
- // TODO: Fix
140
- describe . skip ( 'Output View' , function ( ) {
143
+ describe ( 'Output View' , function ( ) {
141
144
let view : OutputView ;
142
145
143
146
before ( async function ( ) {
@@ -156,28 +159,29 @@ describe('Bottom Bar Example Tests', function () {
156
159
} ) ;
157
160
158
161
it ( 'Clear the output channel' , async function ( ) {
162
+ const delimiter = process . platform === 'win32' ? '\r\n' : '\n' ;
159
163
await view . clearText ( ) ;
160
164
const text = await view . getText ( ) ;
161
165
162
166
// now the log is technically empty, it just contains a newline character
163
- expect ( text ) . equals ( '\n' ) ;
167
+ expect ( text ) . equals ( delimiter ) ;
164
168
} ) ;
165
169
} ) ;
166
170
167
- // TODO: Fix
168
- describe . skip ( 'Terminal View' , function ( ) {
171
+ describe ( 'Terminal View' , function ( ) {
169
172
let view : TerminalView ;
170
173
171
174
before ( async function ( ) {
172
175
view = await bottomBar . openTerminalView ( ) ;
173
176
} ) ;
174
177
175
- it . skip ( 'Execute a command' , async function ( ) {
176
- await view . executeCommand ( 'echo "hello world\\!"' , 2000 ) ;
178
+ it ( 'Execute a command' , async function ( ) {
179
+ const delimiter = process . platform === 'win32' ? '\r\n' : '\n' ;
180
+ await view . executeCommand ( 'echo "hello world"' , 2_000 ) ;
177
181
178
182
// now there should be a line saying 'hello world!' in the terminal
179
183
const text = await view . getText ( ) ;
180
- const textFound = text . split ( '\n' ) . some ( ( line ) => line === 'hello world! ' ) ;
184
+ const textFound = text . split ( delimiter ) . some ( ( line ) => line === 'hello world' ) ;
181
185
182
186
expect ( textFound ) . is . true ;
183
187
} ) ;
0 commit comments