mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-29 16:29:19 -05:00
Change test instead of behavior
This commit is contained in:
@@ -1002,10 +1002,10 @@ namespace ts.server {
|
||||
directory,
|
||||
fileOrDirectory => {
|
||||
const fileOrDirectoryPath = this.toPath(fileOrDirectory);
|
||||
const fileSystemResult = project.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
|
||||
project.getCachedDirectoryStructureHost().addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath);
|
||||
|
||||
// don't trigger callback on open, existing files
|
||||
if (project.fileIsOpen(fileOrDirectoryPath) && fileSystemResult && fileSystemResult.fileExists) {
|
||||
if (project.fileIsOpen(fileOrDirectoryPath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1343,7 +1343,7 @@ var x = 10;`
|
||||
|
||||
it("no project structure update on directory watch invoke on open file save", () => {
|
||||
const projectRootPath = "/users/username/projects/project";
|
||||
const fileA: File = {
|
||||
const file1: File = {
|
||||
path: `${projectRootPath}/a.ts`,
|
||||
content: "export const a = 10;"
|
||||
};
|
||||
@@ -1351,13 +1351,13 @@ var x = 10;`
|
||||
path: `${projectRootPath}/tsconfig.json`,
|
||||
content: "{}"
|
||||
};
|
||||
const files = [fileA, config];
|
||||
const files = [file1, config];
|
||||
const host = createServerHost(files);
|
||||
const service = createProjectService(host);
|
||||
service.openClientFile(fileA.path);
|
||||
service.openClientFile(file1.path);
|
||||
checkNumberOfProjects(service, { configuredProjects: 1 });
|
||||
|
||||
host.invokeWatchedDirectoriesRecursiveCallback(projectRootPath, "a.ts");
|
||||
host.modifyFile(file1.path, file1.content, { invokeFileDeleteCreateAsPartInsteadOfChange: true });
|
||||
host.checkTimeoutQueueLength(0);
|
||||
});
|
||||
|
||||
|
||||
@@ -1000,7 +1000,7 @@ export const x = 10;`
|
||||
verifyWatchesWithConfigFile(host, files, file1, expectedNonRelativeDirectories);
|
||||
|
||||
// invoke callback to simulate saving
|
||||
host.invokeWatchedDirectoriesRecursiveCallback(projectLocation + "/src", "file1.ts");
|
||||
host.modifyFile(file1.path, file1.content, { invokeFileDeleteCreateAsPartInsteadOfChange: true });
|
||||
host.checkTimeoutQueueLengthAndRun(0);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -60,13 +60,14 @@ describe("Test Suite 1", () => {
|
||||
|
||||
const navBarResultUnitTest1 = navBarFull(session, unitTest1);
|
||||
host.deleteFile(unitTest1.path);
|
||||
host.checkTimeoutQueueLengthAndRun(2);
|
||||
checkProjectActualFiles(project, expectedFilesWithoutUnitTest1);
|
||||
host.checkTimeoutQueueLengthAndRun(0);
|
||||
checkProjectActualFiles(project, expectedFilesWithUnitTest1);
|
||||
|
||||
session.executeCommandSeq<protocol.CloseRequest>({
|
||||
command: protocol.CommandTypes.Close,
|
||||
arguments: { file: unitTest1.path }
|
||||
});
|
||||
host.checkTimeoutQueueLengthAndRun(2);
|
||||
checkProjectActualFiles(project, expectedFilesWithoutUnitTest1);
|
||||
|
||||
const unitTest1WithChangedContent: File = {
|
||||
|
||||
Reference in New Issue
Block a user