message: Fix generate assets feature tests
diff: @@ -29,24 +29,52 @@ suite("Asset generation: csproj", () => {
  segments.should.deep.equal(['${workspaceFolder}', 'testApp.csproj']);
  });
  - test("Generated tasks.json has the property GenerateFullPaths set to true ", () => {
  + test("Generated 'build' and 'publish' tasks have the property GenerateFullPaths set to true ", () => {
  let rootPath = path.resolve('testRoot');
  let info = createMSBuildWorkspaceInformation(path.join(rootPath, 'testApp.csproj'), 'testApp', 'netcoreapp1.0');
  let generator = new AssetGenerator(info, createMockWorkspaceFolder(rootPath));
  generator.setStartupProject(0);
  let tasksJson = generator.createTasksConfiguration();
  - tasksJson.tasks.forEach(task => task.args.should.contain("/property:GenerateFullPaths=true"));
  + // We do not check the watch task since this parameter can break hot reload scenarios.
  + tasksJson.tasks
  + .filter(task => task.label !== "watch")
  + .forEach(task => task.args.should.contain("/property:GenerateFullPaths=true"));
  });
  - test("Generated tasks.json has the consoleloggerparameters argument set to NoSummary", () => {
  + test("Generated 'build' and 'publish' tasks have the consoleloggerparameters argument set to NoSummary", () => {
  let rootPath = path.resolve('testRoot');
  let info = createMSBuildWorkspaceInformation(path.join(rootPath, 'testApp.csproj'), 'testApp', 'netcoreapp1.0');
  let generator = new AssetGenerator(info, createMockWorkspaceFolder(rootPath));
  generator.setStartupProject(0);
  let tasksJson = generator.createTasksConfiguration();
  - tasksJson.tasks.forEach(task => task.args.should.contain("/consoleloggerparameters:NoSummary"));
  + // We do not check the watch task since this parameter can break hot reload scenarios.
  + tasksJson.tasks
  + .filter(task => task.label !== "watch")
  + .forEach(task => task.args.should.contain("/consoleloggerparameters:NoSummary"));
  + });
  +
  + test("Generated 'watch' task does not have the property GenerateFullPaths set to true ", () => {
  + let rootPath = path.resolve('testRoot');
  + let info = createMSBuildWorkspaceInformation(path.join(rootPath, 'testApp.csproj'), 'testApp', 'netcoreapp1.0');
  + let generator = new AssetGenerator(info, createMockWorkspaceFolder(rootPath));
  + generator.setStartupProject(0);
  + let tasksJson = generator.createTasksConfiguration();
  +
  + const watchTask = tasksJson.tasks.find(task => task.label === "watch");
  + watchTask.args.should.not.contain("/property:GenerateFullPaths=true");
  + });
  +
  + test("Generated 'watch' task does not have the consoleloggerparameters argument set to NoSummary", () => {
  + let rootPath = path.resolve('testRoot');
  + let info = createMSBuildWorkspaceInformation(path.join(rootPath, 'testApp.csproj'), 'testApp', 'netcoreapp1.0');
  + let generator = new AssetGenerator(info, createMockWorkspaceFolder(rootPath));
  + generator.setStartupProject(0);
  + let tasksJson = generator.createTasksConfiguration();
  +
  + const watchTask = tasksJson.tasks.find(task => task.label === "watch");
  + watchTask.args.should.not.contain("/consoleloggerparameters:NoSummary");
  });
  test("Create tasks.json for nested project opened in workspace", () => {
  