diff options
Diffstat (limited to 'editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts')
-rw-r--r-- | editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts b/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts index 6c7f436f3..2b25eb705 100644 --- a/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts +++ b/editors/code/src/test/utils/diagnotics/SuggestedFix.test.ts | |||
@@ -6,12 +6,12 @@ import SuggestedFix from '../../../utils/diagnostics/SuggestedFix'; | |||
6 | 6 | ||
7 | const location1 = new vscode.Location( | 7 | const location1 = new vscode.Location( |
8 | vscode.Uri.file('/file/1'), | 8 | vscode.Uri.file('/file/1'), |
9 | new vscode.Range(new vscode.Position(1, 2), new vscode.Position(3, 4)) | 9 | new vscode.Range(new vscode.Position(1, 2), new vscode.Position(3, 4)), |
10 | ); | 10 | ); |
11 | 11 | ||
12 | const location2 = new vscode.Location( | 12 | const location2 = new vscode.Location( |
13 | vscode.Uri.file('/file/2'), | 13 | vscode.Uri.file('/file/2'), |
14 | new vscode.Range(new vscode.Position(5, 6), new vscode.Position(7, 8)) | 14 | new vscode.Range(new vscode.Position(5, 6), new vscode.Position(7, 8)), |
15 | ); | 15 | ); |
16 | 16 | ||
17 | describe('SuggestedFix', () => { | 17 | describe('SuggestedFix', () => { |
@@ -20,13 +20,13 @@ describe('SuggestedFix', () => { | |||
20 | const suggestion1 = new SuggestedFix( | 20 | const suggestion1 = new SuggestedFix( |
21 | 'Replace me!', | 21 | 'Replace me!', |
22 | location1, | 22 | location1, |
23 | 'With this!' | 23 | 'With this!', |
24 | ); | 24 | ); |
25 | 25 | ||
26 | const suggestion2 = new SuggestedFix( | 26 | const suggestion2 = new SuggestedFix( |
27 | 'Replace me!', | 27 | 'Replace me!', |
28 | location1, | 28 | location1, |
29 | 'With this!' | 29 | 'With this!', |
30 | ); | 30 | ); |
31 | 31 | ||
32 | assert(suggestion1.isEqual(suggestion2)); | 32 | assert(suggestion1.isEqual(suggestion2)); |
@@ -36,13 +36,13 @@ describe('SuggestedFix', () => { | |||
36 | const suggestion1 = new SuggestedFix( | 36 | const suggestion1 = new SuggestedFix( |
37 | 'Replace me!', | 37 | 'Replace me!', |
38 | location1, | 38 | location1, |
39 | 'With this!' | 39 | 'With this!', |
40 | ); | 40 | ); |
41 | 41 | ||
42 | const suggestion2 = new SuggestedFix( | 42 | const suggestion2 = new SuggestedFix( |
43 | 'Not the same title!', | 43 | 'Not the same title!', |
44 | location1, | 44 | location1, |
45 | 'With this!' | 45 | 'With this!', |
46 | ); | 46 | ); |
47 | 47 | ||
48 | assert(!suggestion1.isEqual(suggestion2)); | 48 | assert(!suggestion1.isEqual(suggestion2)); |
@@ -52,13 +52,13 @@ describe('SuggestedFix', () => { | |||
52 | const suggestion1 = new SuggestedFix( | 52 | const suggestion1 = new SuggestedFix( |
53 | 'Replace me!', | 53 | 'Replace me!', |
54 | location1, | 54 | location1, |
55 | 'With this!' | 55 | 'With this!', |
56 | ); | 56 | ); |
57 | 57 | ||
58 | const suggestion2 = new SuggestedFix( | 58 | const suggestion2 = new SuggestedFix( |
59 | 'Replace me!', | 59 | 'Replace me!', |
60 | location1, | 60 | location1, |
61 | 'With something else!' | 61 | 'With something else!', |
62 | ); | 62 | ); |
63 | 63 | ||
64 | assert(!suggestion1.isEqual(suggestion2)); | 64 | assert(!suggestion1.isEqual(suggestion2)); |
@@ -68,13 +68,13 @@ describe('SuggestedFix', () => { | |||
68 | const suggestion1 = new SuggestedFix( | 68 | const suggestion1 = new SuggestedFix( |
69 | 'Replace me!', | 69 | 'Replace me!', |
70 | location1, | 70 | location1, |
71 | 'With this!' | 71 | 'With this!', |
72 | ); | 72 | ); |
73 | 73 | ||
74 | const suggestion2 = new SuggestedFix( | 74 | const suggestion2 = new SuggestedFix( |
75 | 'Replace me!', | 75 | 'Replace me!', |
76 | location2, | 76 | location2, |
77 | 'With this!' | 77 | 'With this!', |
78 | ); | 78 | ); |
79 | 79 | ||
80 | assert(!suggestion1.isEqual(suggestion2)); | 80 | assert(!suggestion1.isEqual(suggestion2)); |
@@ -85,14 +85,14 @@ describe('SuggestedFix', () => { | |||
85 | 'Replace me!', | 85 | 'Replace me!', |
86 | location1, | 86 | location1, |
87 | 'With this!', | 87 | 'With this!', |
88 | SuggestionApplicability.MachineApplicable | 88 | SuggestionApplicability.MachineApplicable, |
89 | ); | 89 | ); |
90 | 90 | ||
91 | const suggestion2 = new SuggestedFix( | 91 | const suggestion2 = new SuggestedFix( |
92 | 'Replace me!', | 92 | 'Replace me!', |
93 | location2, | 93 | location2, |
94 | 'With this!', | 94 | 'With this!', |
95 | SuggestionApplicability.HasPlaceholders | 95 | SuggestionApplicability.HasPlaceholders, |
96 | ); | 96 | ); |
97 | 97 | ||
98 | assert(!suggestion1.isEqual(suggestion2)); | 98 | assert(!suggestion1.isEqual(suggestion2)); |
@@ -104,7 +104,7 @@ describe('SuggestedFix', () => { | |||
104 | const suggestion = new SuggestedFix( | 104 | const suggestion = new SuggestedFix( |
105 | 'Replace me!', | 105 | 'Replace me!', |
106 | location1, | 106 | location1, |
107 | 'With this!' | 107 | 'With this!', |
108 | ); | 108 | ); |
109 | 109 | ||
110 | const codeAction = suggestion.toCodeAction(); | 110 | const codeAction = suggestion.toCodeAction(); |
@@ -114,7 +114,8 @@ describe('SuggestedFix', () => { | |||
114 | 114 | ||
115 | const edit = codeAction.edit; | 115 | const edit = codeAction.edit; |
116 | if (!edit) { | 116 | if (!edit) { |
117 | return assert.fail('Code Action edit unexpectedly missing'); | 117 | assert.fail('Code Action edit unexpectedly missing'); |
118 | return; | ||
118 | } | 119 | } |
119 | 120 | ||
120 | const editEntries = edit.entries(); | 121 | const editEntries = edit.entries(); |