11import { TextDocument } from "vscode-languageserver-textdocument" ;
2- import { SepticMetaInfoProvider , parseSepticSync } from "../septic" ;
3- import { loadFile } from "./util" ;
2+ import { SepticMetaInfoProvider } from "../septic" ;
3+ import { loadFile , parseSepticForTest } from "./util" ;
44import {
55 Position ,
66 CodeActionParams ,
@@ -35,7 +35,7 @@ describe("Test codeaction for inserting evr", () => {
3535 } ,
3636 } ;
3737 const content = loadFile ( "codeAction.cnfg" ) ;
38- const cnfg = parseSepticSync ( content ) ;
38+ const cnfg = parseSepticForTest ( content ) ;
3939 await cnfg . updateObjectParents (
4040 SepticMetaInfoProvider . getInstance ( ) . getObjectHierarchy ( )
4141 ) ;
@@ -66,7 +66,7 @@ describe("Test codeaction for inserting evr", () => {
6666 } ,
6767 } ;
6868 const content = loadFile ( "codeAction.cnfg" ) ;
69- const cnfg = parseSepticSync ( content ) ;
69+ const cnfg = parseSepticForTest ( content ) ;
7070 cnfg . updateObjectParents (
7171 SepticMetaInfoProvider . getInstance ( ) . getObjectHierarchy ( )
7272 ) ;
@@ -97,7 +97,7 @@ describe("Test codeaction for inserting evr", () => {
9797 } ,
9898 } ;
9999 const content = loadFile ( "codeAction.cnfg" ) ;
100- const cnfg = parseSepticSync ( content ) ;
100+ const cnfg = parseSepticForTest ( content ) ;
101101 cnfg . updateObjectParents (
102102 SepticMetaInfoProvider . getInstance ( ) . getObjectHierarchy ( )
103103 ) ;
@@ -121,7 +121,7 @@ describe("Test codeaction for inserting evr", () => {
121121 } ,
122122 } ;
123123 const content = loadFile ( "codeAction.cnfg" ) ;
124- const cnfg = parseSepticSync ( content ) ;
124+ const cnfg = parseSepticForTest ( content ) ;
125125 cnfg . updateObjectParents (
126126 SepticMetaInfoProvider . getInstance ( ) . getObjectHierarchy ( )
127127 ) ;
@@ -152,7 +152,7 @@ describe("Test codeaction for ignoring warning", () => {
152152 } ,
153153 } ;
154154 const content = loadFile ( "codeActionIgnore.cnfg" ) ;
155- const cnfg = parseSepticSync ( content ) ;
155+ const cnfg = parseSepticForTest ( content ) ;
156156 const doc = TextDocument . create ( "" , "" , 0 , content ) ;
157157 const codeActions = getCodeActionIgnoreDiagnostics ( params , cnfg , doc ) ;
158158 expect ( codeActions . length ) . to . equal ( 2 ) ;
@@ -179,7 +179,7 @@ describe("Test codeaction for ignoring warning", () => {
179179 } ,
180180 } ;
181181 const content = loadFile ( "codeActionIgnore.cnfg" ) ;
182- const cnfg = parseSepticSync ( content ) ;
182+ const cnfg = parseSepticForTest ( content ) ;
183183 const doc = TextDocument . create ( "" , "" , 0 , content ) ;
184184 const codeActions = getCodeActionIgnoreDiagnostics ( params , cnfg , doc ) ;
185185 expect ( codeActions . length ) . to . equal ( 1 ) ;
@@ -188,7 +188,7 @@ describe("Test codeaction for ignoring warning", () => {
188188 0
189189 ) as TextDocumentEdit ;
190190 const updatedeContent = TextDocument . applyEdits ( doc , textEdits . edits ) ;
191- const updatedCnfg = parseSepticSync ( updatedeContent ) ;
191+ const updatedCnfg = parseSepticForTest ( updatedeContent ) ;
192192 expect ( updatedCnfg . comments [ 0 ] . content ) . to . equal (
193193 "{# noqa: W501, E202 #}"
194194 ) ;
@@ -213,7 +213,7 @@ describe("Test codeaction for ignoring warning", () => {
213213 } ,
214214 } ;
215215 const content = loadFile ( "codeActionIgnore.cnfg" ) ;
216- const cnfg = parseSepticSync ( content ) ;
216+ const cnfg = parseSepticForTest ( content ) ;
217217 const doc = TextDocument . create ( "" , "" , 0 , content ) ;
218218 const codeActions = getCodeActionIgnoreDiagnostics ( params , cnfg , doc ) ;
219219 expect ( codeActions . length ) . to . equal ( 1 ) ;
@@ -222,7 +222,7 @@ describe("Test codeaction for ignoring warning", () => {
222222 0
223223 ) as TextDocumentEdit ;
224224 const updatedeContent = TextDocument . applyEdits ( doc , textEdits . edits ) ;
225- const updatedCnfg = parseSepticSync ( updatedeContent ) ;
225+ const updatedCnfg = parseSepticForTest ( updatedeContent ) ;
226226 expect ( updatedCnfg . comments [ 1 ] . content ) . to . equal ( "// noqa: W501, E202" ) ;
227227 } ) ;
228228 it ( "Expect code actions to suggest updating ignore comments for all codes" , async ( ) => {
@@ -251,7 +251,7 @@ describe("Test codeaction for ignoring warning", () => {
251251 } ,
252252 } ;
253253 const content = loadFile ( "codeActionIgnore.cnfg" ) ;
254- const cnfg = parseSepticSync ( content ) ;
254+ const cnfg = parseSepticForTest ( content ) ;
255255 const doc = TextDocument . create ( "" , "" , 0 , content ) ;
256256 const codeActions = getCodeActionIgnoreDiagnostics ( params , cnfg , doc ) ;
257257 expect ( codeActions . length ) . to . equal ( 2 ) ;
@@ -285,7 +285,7 @@ describe("Test codeaction for ignoring warning", () => {
285285 } ,
286286 } ;
287287 const content = loadFile ( "codeActionIgnore.cnfg" ) ;
288- const cnfg = parseSepticSync ( content ) ;
288+ const cnfg = parseSepticForTest ( content ) ;
289289 const doc = TextDocument . create ( "" , "" , 0 , content ) ;
290290 const codeActions = getCodeActionIgnoreDiagnostics ( params , cnfg , doc ) ;
291291 expect ( codeActions . length ) . to . equal ( 2 ) ;
@@ -312,7 +312,7 @@ describe("Test codeaction for ignoring warning", () => {
312312 } ,
313313 } ;
314314 const content = loadFile ( "codeActionIgnore.cnfg" ) ;
315- const cnfg = parseSepticSync ( content ) ;
315+ const cnfg = parseSepticForTest ( content ) ;
316316 const doc = TextDocument . create ( "" , "" , 0 , content ) ;
317317 const codeActions = getCodeActionIgnoreDiagnostics ( params , cnfg , doc ) ;
318318 expect ( codeActions . length ) . to . equal ( 0 ) ;
@@ -337,7 +337,7 @@ describe("Test codeaction for ignoring warning", () => {
337337 } ,
338338 } ;
339339 const content = loadFile ( "codeActionIgnore.cnfg" ) ;
340- const cnfg = parseSepticSync ( content ) ;
340+ const cnfg = parseSepticForTest ( content ) ;
341341 const doc = TextDocument . create ( "" , "" , 0 , content ) ;
342342 const codeActions = getCodeActionIgnoreDiagnostics ( params , cnfg , doc ) ;
343343 expect ( codeActions . length ) . to . equal ( 0 ) ;
0 commit comments