Skip to content

Make cachingInServerLSHost tests work with runtests-browser #11974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 commit merged into from
Nov 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 10 additions & 26 deletions src/harness/unittests/cachingInServerLSHost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,17 @@ namespace ts {
newLine: "\r\n",
useCaseSensitiveFileNames: false,
write: noop,
readFile: (path: string): string => {
return path in fileMap ? fileMap[path].content : undefined;
},
writeFile: (_path: string, _data: string, _writeByteOrderMark?: boolean) => {
return ts.notImplemented();
},
resolvePath: (_path: string): string => {
return ts.notImplemented();
},
fileExists: (path: string): boolean => {
return path in fileMap;
},
directoryExists: (path: string): boolean => {
return existingDirectories[path] || false;
},
readFile: path => path in fileMap ? fileMap[path].content : undefined,
writeFile: notImplemented,
resolvePath: notImplemented,
fileExists: path => path in fileMap,
directoryExists: path => existingDirectories[path] || false,
createDirectory: noop,
getExecutingFilePath: (): string => {
return "";
},
getCurrentDirectory: (): string => {
return "";
},
getExecutingFilePath: () => "",
getCurrentDirectory: () => "",
getDirectories: () => [],
getEnvironmentVariable: () => "",
readDirectory: (_path: string, _extension?: string[], _exclude?: string[], _include?: string[]): string[] => {
return ts.notImplemented();
},
readDirectory: notImplemented,
exit: noop,
watchFile: () => ({
close: noop
Expand All @@ -58,8 +42,8 @@ namespace ts {
}),
setTimeout,
clearTimeout,
setImmediate,
clearImmediate
setImmediate: typeof setImmediate !== "undefined" ? setImmediate : action => setTimeout(action, 0),
clearImmediate: typeof clearImmediate !== "undefined" ? clearImmediate : clearTimeout
};
}

Expand Down