diff --git a/packages/vue-language-service/tests/complete.ts b/packages/vue-language-service/tests/complete.ts index ed4eae209f..220e485939 100644 --- a/packages/vue-language-service/tests/complete.ts +++ b/packages/vue-language-service/tests/complete.ts @@ -75,7 +75,6 @@ for (const dirName of testDirs) { expect(result.replace(/\r\n/g, '\n')).toBe(expectedFileText.replace(/\r\n/g, '\n')); }); } - } }); } diff --git a/packages/vue-language-service/tests/utils/createTester.ts b/packages/vue-language-service/tests/utils/createTester.ts index 4c629b6d74..aec3a3388b 100644 --- a/packages/vue-language-service/tests/utils/createTester.ts +++ b/packages/vue-language-service/tests/utils/createTester.ts @@ -40,7 +40,36 @@ function createTester(root: string) { getScriptSnapshot, getVueCompilationSettings: () => ({}), }; - const languageService = createLanguageService({ typescript: ts }, host, undefined, undefined, undefined, []); + const vscodeSettings: any = { + typescript: { + preferences: { + quoteStyle: 'single', + }, + }, + javascript: { + preferences: { + quoteStyle: 'single', + }, + }, + }; + const languageService = createLanguageService({ typescript: ts }, host, undefined, undefined, { + async getConfiguration(section: string) { + const keys = section.split('.'); + let settings = vscodeSettings; + for (const key of keys) { + if (key in settings) { + settings = settings[key]; + } + else { + settings = undefined; + break; + } + } + return settings; + }, + onDidChangeConfiguration() { }, + rootUris: [], + }, []); return { host,