public static void Initialize(TestContext c) { SettingsStore.EnterTestMode(new WESettings { Scss = { GenerateSourceMaps = false } }); }
public static void Initialize(TestContext c) { SettingsStore.EnterTestMode(new WESettings { Handlebars = { MinifyInPlace = false } }); }
public static void Initialize(TestContext c) { // Using FullyQualifiedTestClassName gives native PathTooLong errors when creating projects TestCaseDirectory = Path.Combine(Path.GetTempPath(), "Web Essentials Test Files", "DependencyGraphTests-" + DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")); Directory.CreateDirectory(TestCaseDirectory); SettingsStore.EnterTestMode(); }
public static void Initialize(TestContext c) { //DTE.ToString(); // Force initial launch to avoid funceval issues //System.Diagnostics.Debugger.Launch(); SettingsStore.EnterTestMode(); TestCaseDirectory = Path.Combine(Path.GetTempPath(), "Web Essentials Test Files", c.FullyQualifiedTestClassName + "-" + DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")); Directory.CreateDirectory(TestCaseDirectory); }
public static void ObscureNode(TestContext context) { SettingsStore.EnterTestMode(new WESettings { Less = { GenerateSourceMaps = false } }); originalPath = Environment.GetEnvironmentVariable("PATH"); Environment.SetEnvironmentVariable("PATH", originalPath.Replace(@";C:\Program Files\nodejs\", ""), EnvironmentVariableTarget.Process); }
public static void Initialize(TestContext c) { // Using FullyQualifiedTestClassName gives native PathTooLong errors when creating projects TestCaseDirectory = Path.Combine(Path.GetTempPath(), "Web Essentials Test Files", "ChainCompilationTests-" + DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss")); Directory.CreateDirectory(TestCaseDirectory); SettingsStore.EnterTestMode(); WESettings.Instance.Less.EnableChainCompilation = true; WESettings.Instance.Less.CompileOnSave = true; }
public async Task BlockCommentCompletion() { SettingsStore.EnterTestMode(new WESettings { JavaScript = { BlockCommentCompletion = true } }); var textView = await VSHost.TypeText(".js", "/*"); textView.GetText().Should().Be("/**/"); }
public async Task BlockCommentStarCompletionDisabled() { SettingsStore.EnterTestMode(new WESettings { JavaScript = { BlockCommentCompletion = false } }); var textView = await VSHost.TypeText(".js", "/*\n"); textView.GetText().Should().Be("/*\r\n"); }
public async Task DontCompileOnOpen() { SettingsStore.EnterTestMode(); var fileName = Path.Combine(TestCaseDirectory, "Don'tCompile-" + Guid.NewGuid() + ".coffee"); File.WriteAllText(fileName, @"a{b{color:red;}}"); DTE.ItemOperations.OpenFile(fileName); await Task.Delay(TimeSpan.FromSeconds(5)); File.Exists(Path.ChangeExtension(fileName, ".js")).Should().BeFalse("Should not compile without saving"); }
public async Task CompileLessOnSaveWithoutProject() { SettingsStore.EnterTestMode(); var fileName = Path.Combine(TestCaseDirectory, "Compile-" + Guid.NewGuid() + ".less"); File.WriteAllText(fileName, @"a{b{color:red;}}"); DTE.ItemOperations.OpenFile(fileName).Document.Save(); await WaitFor(() => File.Exists(Path.ChangeExtension(fileName, ".css")), 10); File.Exists(Path.ChangeExtension(fileName, ".min.css")).Should().BeFalse("Should not minify by default"); }
public async Task SkippableFiles() { SettingsStore.EnterTestMode(); foreach (var baseName in new[] { "_underscore", "Sprite.png" }) { var fileName = Path.Combine(TestCaseDirectory, baseName + ".less"); File.WriteAllText(fileName, @"a{b{color:red;}}"); DTE.ItemOperations.OpenFile(fileName).Document.Save(); await Task.Delay(TimeSpan.FromSeconds(7.5)); File.Exists(Path.ChangeExtension(fileName, ".css")).Should().BeFalse("Should not compile " + baseName + ".less"); } }
public async Task MinifyOnSave() { SettingsStore.EnterTestMode(); WESettings.Instance.Html.AutoMinify = true; WESettings.Instance.Html.GzipMinifiedFiles = true; WESettings.Instance.Markdown.CompileOnSave = true; var fileName = Path.Combine(TestCaseDirectory, "Minify-" + Guid.NewGuid() + ".md"); var minFileName = Path.ChangeExtension(fileName, ".min.html"); File.WriteAllText(fileName, "Hi\n#Header\n\n**Bold!**"); File.Create(Path.Combine(minFileName)).Close(); // Only files that have a .min will be minified. DTE.ItemOperations.OpenFile(fileName).Document.Save(); await WaitFor(() => new FileInfo(minFileName).Length > 0, 10); }
public static void Initialize(TestContext c) { SettingsStore.EnterTestMode(); }
public static void Initialize(TestContext c) { SettingsStore.EnterTestMode(); VSHost.EnsureSolution(@"ProjectEnumeration\ProjectEnumeration.sln"); }