コード例 #1
0
        public async Task AssertNpmInstallSucceeded()
        {
            await this.EnsureNpmCacheInitialized();

            DirectoryExtended.Copy(this.npmModulesDirectoryPath, Path.Combine(this.tempDirectoryPath, "node_modules"));
            await ProcessAssert.AssertStart(this.tempDirectoryPath, GetNpmFilePath(), "install", TimeSpan.FromMinutes(5));
        }
コード例 #2
0
 public async Task AssertBowerInstallSucceeded()
 {
     await ProcessAssert.AssertStart(
         this.tempDirectoryPath,
         @"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External\bower.cmd",
         "install",
         TimeSpan.FromSeconds(30));
 }
コード例 #3
0
        public async Task AssertDotnetBuildSucceeded()
        {
            await ProcessAssert.AssertStart(this.tempDirectoryPath, "dotnet", "restore", TimeSpan.FromSeconds(20));

            await Task.Delay(2000);

            await ProcessAssert.AssertStart(this.tempDirectoryPath, "dotnet", "build", TimeSpan.FromSeconds(20));
        }
コード例 #4
0
        public async Task AssertGulpCleanBuildTestSucceeded()
        {
            var gulpFilePath = Path.Combine(this.tempDirectoryPath, @"node_modules\.bin\gulp.cmd");
            await ProcessAssert.AssertStart(this.tempDirectoryPath, gulpFilePath, "clean", TimeSpan.FromSeconds(10));

            await ProcessAssert.AssertStart(this.tempDirectoryPath, gulpFilePath, "build", TimeSpan.FromSeconds(10));

            await ProcessAssert.AssertStart(this.tempDirectoryPath, gulpFilePath, "test", TimeSpan.FromSeconds(10));
        }
コード例 #5
0
        private async Task EnsureNpmCacheInitialized()
        {
            var packageJsonFilePath = Path.Combine(this.projectDirectoryPath, "package.json");

            if (!Directory.Exists(this.npmModulesDirectoryPath))
            {
                if (!Directory.Exists(this.npmCacheDirectoryPath))
                {
                    Directory.CreateDirectory(this.npmCacheDirectoryPath);
                }

                var npmCachePackageJsonFilePath = Path.Combine(this.npmCacheDirectoryPath, "package.json");
                File.Copy(packageJsonFilePath, npmCachePackageJsonFilePath, true);
                File.WriteAllLines(
                    npmCachePackageJsonFilePath,
                    File.ReadAllLines(npmCachePackageJsonFilePath).Where(x => !x.Contains("//")));

                await ProcessAssert.AssertStart(this.npmCacheDirectoryPath, GetNpmFilePath(), "install", TimeSpan.FromMinutes(10));
            }
        }
コード例 #6
0
 public async Task AssertNpmInstallSucceeded()
 {
     var nodeDirectoryPath = Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Machine).Split(';').First(x => x.Contains("nodejs"));
     var npmFilePath       = Path.Combine(nodeDirectoryPath, "npm.cmd");
     await ProcessAssert.AssertStart(this.tempDirectoryPath, npmFilePath, "install", TimeSpan.FromMinutes(5));
 }