Run tests against both csproj and project.json-style projects. Assumes relevant dotnet SDKs are installed locally.

This commit is contained in:
SteveSandersonMS 2016-12-15 17:17:04 +00:00
Родитель f34eb582ad
Коммит 4fd19b4293
1 изменённых файлов: 95 добавлений и 90 удалений

Просмотреть файл

@ -5,15 +5,17 @@ import { generateProjectSync } from './util/yeoman';
import { AspNetProcess, AspNetCoreEnviroment, defaultUrl, publishProjectSync } from './util/aspnet';
import { getValue, getCssPropertyValue } from './util/webdriverio';
// Currently we test both 'csproj' and 'project.json' project types. Eventually we'll only need csproj.
['csproj', 'projectjson'].forEach(toolingType => {
// First, generate a new project using the locally-built generator-aspnetcore-spa
// Do this outside the Mocha fixture, otherwise Mocha will time out
const appDir = path.resolve(__dirname, '../generated/angular');
const appDir = path.resolve(__dirname, '../generated/angular', toolingType);
const publishedAppDir = path.resolve(appDir, './bin/Release/published');
if (!process.env.SKIP_PROJECT_GENERATION) {
generateProjectSync(appDir, {
framework: 'angular-2',
name: 'Test App',
sdkVersion: '1.0.0-preview2-1-003177',
sdkVersion: toolingType === 'projectjson' ? '1.0.0-preview2-1-003177' : '1.0.0-preview3-004056',
tests: false
});
publishProjectSync(appDir, publishedAppDir);
@ -96,6 +98,9 @@ describe('Angular template: dev mode', () => {
});
describe('Angular template: production mode', () => {
AspNetProcess.RunInMochaContext(publishedAppDir, AspNetCoreEnviroment.production, 'angular.dll');
// csproj tooling takes the assembly name from <name>.csproj, whereas project.json takes it from the directory name
const assemblyName = toolingType === 'csproj' ? 'TestApp.dll' : 'projectjson.dll';
AspNetProcess.RunInMochaContext(publishedAppDir, AspNetCoreEnviroment.production, assemblyName);
testBasicNavigation();
});
});