File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
src/testRunner/unittests/tsserver Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -861,4 +861,38 @@ declare module '@custom/plugin' {
861
861
] ) ;
862
862
} ) ;
863
863
} ) ;
864
+
865
+ describe ( "unittests:: tsserver:: Project Errors with resolveJsonModule" , ( ) => {
866
+ it ( "should not report incorrect error when json is root file found by tsconfig" , ( ) => {
867
+ const test : File = {
868
+ path : `${ projectRoot } /src/test.ts` ,
869
+ content : `import * as blabla from "./blabla.json"`
870
+ } ;
871
+ const blabla : File = {
872
+ path : `${ projectRoot } /src/blabla.json` ,
873
+ content : "{}"
874
+ } ;
875
+ const tsconfig : File = {
876
+ path : `${ projectRoot } /tsconfig.json` ,
877
+ content : JSON . stringify ( {
878
+ compilerOptions : {
879
+ resolveJsonModule : true ,
880
+ composite : true
881
+ } ,
882
+ include : [ "./src/*.ts" , "./src/*.json" ]
883
+ } )
884
+ } ;
885
+
886
+ const host = createServerHost ( [ test , blabla , libFile , tsconfig ] ) ;
887
+ const session = createSession ( host ) ;
888
+ openFilesForSession ( [ test ] , session ) ;
889
+ verifyGetErrRequest ( {
890
+ session,
891
+ host,
892
+ expected : [
893
+ { file : test , syntax : [ ] , semantic : [ ] , suggestion : [ ] }
894
+ ]
895
+ } ) ;
896
+ } ) ;
897
+ } ) ;
864
898
}
You can’t perform that action at this time.
0 commit comments