File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
test/integration-tests/ui Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -17,12 +17,24 @@ import { SwiftOutputChannel } from "../../../src/ui/SwiftOutputChannel";
17
17
18
18
suite ( "SwiftOutputChannel" , function ( ) {
19
19
let channel : SwiftOutputChannel ;
20
- setup ( ( ) => {
21
- channel = new SwiftOutputChannel ( "SwiftOutputChannel Tests" , false , 3 ) ;
20
+ const channels : SwiftOutputChannel [ ] = [ ] ;
21
+ setup ( function ( ) {
22
+ const channelName = `SwiftOutputChannel Tests ${ this . currentTest ?. id ?? "<unknown test>" } ` ;
23
+ channel = new SwiftOutputChannel ( channelName , false , 3 ) ;
24
+ channels . push ( channel ) ;
22
25
} ) ;
23
26
24
- teardown ( ( ) => {
25
- channel . dispose ( ) ;
27
+ suiteTeardown ( async function ( ) {
28
+ // Output channels are added to their disposable store asynchronously, which leads
29
+ // to warnings in the console if we dispose of them immediately after the test.
30
+ // https://github.com/microsoft/vscode/blob/1f8fd7adeff6c113f9226787bdf4f417e6bdfb11/src/vs/workbench/api/common/extHostOutput.ts#L150
31
+ // As a workaround, we wait for a short period of time before disposing of the channels
32
+ await new Promise ( resolve =>
33
+ setTimeout ( ( ) => {
34
+ channels . forEach ( channel => channel . dispose ( ) ) ;
35
+ resolve ( void 0 ) ;
36
+ } , 50 )
37
+ ) ;
26
38
} ) ;
27
39
28
40
test ( "Appends logs" , ( ) => {
You can’t perform that action at this time.
0 commit comments