From c6ebb77ceced6981eba80c2ea2750c43659fcc02 Mon Sep 17 00:00:00 2001 From: Keen Yee Liau Date: Wed, 9 Sep 2020 14:59:02 -0700 Subject: [PATCH] test(language-service): [ivy] remove all markers from test (#38777) In the test project there are no longer reference markers and location markers, so there's no need to "pre-process" the source files to remove them. This will make the Ivy tests cleaner and faster. PR Close #38777 --- .../language-service/ivy/test/mock_host.ts | 20 +------------------ 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/packages/language-service/ivy/test/mock_host.ts b/packages/language-service/ivy/test/mock_host.ts index 152c2200f4..19041952db 100644 --- a/packages/language-service/ivy/test/mock_host.ts +++ b/packages/language-service/ivy/test/mock_host.ts @@ -45,14 +45,7 @@ export const host: ts.server.ServerHost = { ...ts.sys, readFile(absPath: string, encoding?: string): string | undefined { - const content = ts.sys.readFile(absPath, encoding); - if (content === undefined) { - return undefined; - } - if (absPath === APP_COMPONENT || absPath === PARSING_CASES || absPath === TEST_TEMPLATE) { - return removeReferenceMarkers(removeLocationMarkers(content)); - } - return content; + return ts.sys.readFile(absPath, encoding); }, watchFile(path: string, callback: ts.FileWatcherCallback): ts.FileWatcher { return NOOP_FILE_WATCHER; @@ -206,14 +199,3 @@ function replaceOnce(searchText: string, regex: RegExp, replaceText: string): Ov }); return {position, text}; } - -const REF_MARKER = /«(((\w|\-)+)|([^ᐱ]*ᐱ(\w+)ᐱ.[^»]*))»/g; -const LOC_MARKER = /\~\{(\w+(-\w+)*)\}/g; - -function removeReferenceMarkers(value: string): string { - return value.replace(REF_MARKER, ''); -} - -function removeLocationMarkers(value: string): string { - return value.replace(LOC_MARKER, ''); -}