Skip to content

Commit dcb6de6

Browse files
committed
Test
1 parent 6f04f52 commit dcb6de6

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/testRunner/unittests/tsserver/projectErrors.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,4 +861,38 @@ declare module '@custom/plugin' {
861861
]);
862862
});
863863
});
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+
});
864898
}

0 commit comments

Comments
 (0)