4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
6
import { getFakeVsCode } from "../testAssets/Fakes" ;
7
- import fileIssue from "../../../src/features/fileIssue " ;
7
+ import reportIssue from "../../../src/features/reportIssue " ;
8
8
import { EventStream } from "../../../src/EventStream" ;
9
9
import TestEventBus from "../testAssets/TestEventBus" ;
10
10
import { expect } from "chai" ;
11
11
import { ReportIssue } from "../../../src/omnisharp/loggingEvents" ;
12
12
import { vscode } from "../../../src/vscodeAdapter" ;
13
13
14
- suite ( "File Issue " , ( ) => {
14
+ suite ( "reportIssue " , ( ) => {
15
15
const vscodeVersion = "myVersion" ;
16
16
const csharpExtVersion = "csharpExtVersion" ;
17
17
const monoInfo = "myMonoInfo" ;
@@ -72,54 +72,54 @@ suite("File Issue", () => {
72
72
} ) ;
73
73
74
74
test ( `${ ReportIssue . name } event is created` , async ( ) => {
75
- await fileIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
75
+ await reportIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
76
76
let events = eventBus . getEvents ( ) ;
77
77
expect ( events ) . to . have . length ( 1 ) ;
78
78
expect ( events [ 0 ] . constructor . name ) . to . be . equal ( `${ ReportIssue . name } ` ) ;
79
79
} ) ;
80
80
81
81
test ( "${ReportIssue.name} event is created with the omnisharp-vscode github repo issues url" , async ( ) => {
82
- await fileIssue ( vscode , eventStream , execChildProcess , false ) ;
82
+ await reportIssue ( vscode , eventStream , execChildProcess , false ) ;
83
83
expect ( execCommands ) . to . not . contain ( "mono --version" ) ;
84
84
let event = < ReportIssue > eventBus . getEvents ( ) [ 0 ] ;
85
85
expect ( event . url ) . to . be . equal ( "https://github.com/OmniSharp/omnisharp-vscode/issues/new" ) ;
86
86
} ) ;
87
87
88
88
test ( "The body contains the vscode version" , async ( ) => {
89
- await fileIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
89
+ await reportIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
90
90
let event = < ReportIssue > eventBus . getEvents ( ) [ 0 ] ;
91
91
expect ( event . body ) . to . contain ( encodeURIComponent ( `**VSCode version**: ${ vscodeVersion } ` ) ) ;
92
92
} ) ;
93
93
94
94
test ( "The body contains the csharp extension version" , async ( ) => {
95
- await fileIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
95
+ await reportIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
96
96
let event = < ReportIssue > eventBus . getEvents ( ) [ 0 ] ;
97
97
expect ( event . body ) . to . contain ( encodeURIComponent ( `**C# Extension**: ${ csharpExtVersion } ` ) ) ;
98
98
} ) ;
99
99
100
100
test ( "dotnet info is obtained and put into the body" , async ( ) => {
101
- await fileIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
101
+ await reportIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
102
102
expect ( execCommands ) . to . contain ( "dotnet --info" ) ;
103
103
let event = < ReportIssue > eventBus . getEvents ( ) [ 0 ] ;
104
104
expect ( event . body ) . to . contain ( dotnetInfo ) ;
105
105
} ) ;
106
106
107
107
test ( "mono information is obtained when it is a valid mono platform" , async ( ) => {
108
- await fileIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
108
+ await reportIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
109
109
expect ( execCommands ) . to . contain ( "mono --version" ) ;
110
110
let event = < ReportIssue > eventBus . getEvents ( ) [ 0 ] ;
111
111
expect ( event . body ) . to . contain ( monoInfo ) ;
112
112
} ) ;
113
113
114
114
test ( "mono information is not obtained when it is not a valid mono platform" , async ( ) => {
115
- await fileIssue ( vscode , eventStream , execChildProcess , false ) ;
115
+ await reportIssue ( vscode , eventStream , execChildProcess , false ) ;
116
116
expect ( execCommands ) . to . not . contain ( "mono --version" ) ;
117
117
let event = < ReportIssue > eventBus . getEvents ( ) [ 0 ] ;
118
118
expect ( event . body ) . to . not . contain ( monoInfo ) ;
119
119
} ) ;
120
120
121
121
test ( "The body contains all the name, publisher and version for the extensions that are not builtin" , async ( ) => {
122
- await fileIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
122
+ await reportIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
123
123
let event = < ReportIssue > eventBus . getEvents ( ) [ 0 ] ;
124
124
expect ( event . body ) . to . contain ( extension2 . packageJSON . name ) ;
125
125
expect ( event . body ) . to . contain ( extension2 . packageJSON . publisher ) ;
@@ -130,7 +130,7 @@ suite("File Issue", () => {
130
130
} ) ;
131
131
132
132
test ( "issuesUrl is put into the event url" , async ( ) => {
133
- await fileIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
133
+ await reportIssue ( vscode , eventStream , execChildProcess , isValidForMono ) ;
134
134
let event = < ReportIssue > eventBus . getEvents ( ) [ 0 ] ;
135
135
expect ( event . url ) . to . be . equal ( "https://github.com/OmniSharp/omnisharp-vscode/issues/new" ) ;
136
136
} ) ;
0 commit comments