test: re-enable disabled architect build tests

This commit is contained in:
Filipe Silva 2018-03-15 12:12:26 +00:00 committed by Hans
parent 38c8463280
commit b75b21f13c
93 changed files with 186 additions and 552 deletions

View File

@ -101,6 +101,7 @@ const expectedWorkspace = {
}, },
'configurations': { 'configurations': {
'production': { 'production': {
'optimizationLevel': 1,
'outputHashing': 'all', 'outputHashing': 'all',
'sourceMap': false, 'sourceMap': false,
'extractCss': true, 'extractCss': true,
@ -182,6 +183,7 @@ const expectedWorkspace = {
}, },
'configurations': { 'configurations': {
'production': { 'production': {
'optimizationLevel': 1,
'outputHashing': 'all', 'outputHashing': 'all',
'sourceMap': false, 'sourceMap': false,
'extractCss': true, 'extractCss': true,

View File

@ -43,6 +43,7 @@ export function createArchitectWorkspace(cliConfig: any): any {
options: browserOptions, options: browserOptions,
configurations: { configurations: {
production: { production: {
optimizationLevel: 1,
outputHashing: 'all', outputHashing: 'all',
sourceMap: false, sourceMap: false,
extractCss: true, extractCss: true,

View File

@ -3,8 +3,7 @@ import { updateTsConfig } from '../../utils/project';
import { appendToFile, writeFile } from '../../utils/fs'; import { appendToFile, writeFile } from '../../utils/fs';
export default async function() { export default async function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
await writeFile('src/my-js-file.js', 'console.log(1); export const a = 2;'); await writeFile('src/my-js-file.js', 'console.log(1); export const a = 2;');
await appendToFile('src/main.ts', ` await appendToFile('src/main.ts', `

View File

@ -4,13 +4,9 @@ import {expectToFail} from '../../../utils/utils';
import {ngVersionMatches} from '../../../utils/version'; import {ngVersionMatches} from '../../../utils/version';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): This behaviour seems to have changed in devkit/build-webpack. Figure out why.
return; return;
if (!ngVersionMatches('^4.0.0')) {
return Promise.resolve();
}
return ng('generate', 'component', 'test-component', '--module', 'app.module.ts') return ng('generate', 'component', 'test-component', '--module', 'app.module.ts')
.then(() => prependToFile('src/app/test-component/test-component.component.ts', ` .then(() => prependToFile('src/app/test-component/test-component.component.ts', `
import { Optional, SkipSelf } from '@angular/core'; import { Optional, SkipSelf } from '@angular/core';

View File

@ -5,8 +5,7 @@ import {Version} from '../../../../../packages/@angular/cli/upgrade/version';
import { SemVer } from 'semver'; import { SemVer } from 'semver';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
.then(() => createDir('src/locale')) .then(() => createDir('src/locale'))
@ -25,7 +24,7 @@ export default function() {
</xliff>`)) </xliff>`))
.then(() => appendToFile('src/app/app.component.html', .then(() => appendToFile('src/app/app.component.html',
'<h1 i18n="An introduction header for this sample">Hello i18n!</h1>')) '<h1 i18n="An introduction header for this sample">Hello i18n!</h1>'))
.then(() => ng('build', '--aot', '--i18n-file', 'src/locale/messages.fr.xlf', '--i18n-format', .then(() => ng('build', '--aot', '--i18n-file', 'locale/messages.fr.xlf', '--i18n-format',
'xlf', '--i18n-locale', 'fr')) 'xlf', '--i18n-locale', 'fr'))
.then(() => expectFileToMatch('dist/main.js', /Bonjour i18n!/)) .then(() => expectFileToMatch('dist/main.js', /Bonjour i18n!/))
.then(() => ng('build', '--aot')) .then(() => ng('build', '--aot'))
@ -33,29 +32,9 @@ export default function() {
.then(() => expectFileToMatch('dist/main.js', /Hello i18n!/)) .then(() => expectFileToMatch('dist/main.js', /Hello i18n!/))
.then(() => appendToFile('src/app/app.component.html', .then(() => appendToFile('src/app/app.component.html',
'<p i18n>Other content</p>')) '<p i18n>Other content</p>'))
.then(() => readFile('node_modules/@angular/compiler-cli/package.json') .then(() => ng('build', '--aot', '--i18nFile', 'locale/messages.fr.xlf', '--i18nFormat',
.then((compilerCliPackage): any => { 'xlf', '--i18n-locale', 'fr', '--i18n-missing-translation', 'ignore'))
const version = new Version(JSON.parse(compilerCliPackage).version); .then(() => expectFileToMatch('dist/main.js', /Other content/))
if (version.major === 2) { .then(() => expectToFail(() => ng('build', '--aot', '--i18nFile', 'locale/messages.fr.xlf',
return expectToFail(() => ng('build', '--aot', '--i18nFile', 'src/locale/messages.fr.xlf', '--i18nFormat', 'xlf', '--i18n-locale', 'fr', '--i18n-missing-translation', 'error')));
'--i18nFormat', 'xlf', '--i18n-locale', 'fr', '--i18n-missing-translation', 'ignore'));
} else {
return ng('build', '--aot', '--i18nFile', 'src/locale/messages.fr.xlf', '--i18nFormat',
'xlf', '--i18n-locale', 'fr', '--i18n-missing-translation', 'ignore')
.then(() => expectFileToMatch('dist/main.js', /Other content/));
}
})
)
.then(() => readFile('node_modules/@angular/compiler-cli/package.json')
.then((compilerCliPackage): any => {
const version = new Version(JSON.parse(compilerCliPackage).version);
if (version.isGreaterThanOrEqualTo(new SemVer('4.2.0-beta.0')) || version.major === 2) {
return expectToFail(() => ng('build', '--aot', '--i18nFile', 'src/locale/messages.fr.xlf',
'--i18nFormat', 'xlf', '--i18n-locale', 'fr', '--i18n-missing-translation', 'error'));
} else {
return ng('build', '--aot', '--i18nFile', 'src/locale/messages.fr.xlf',
'--i18nFormat', 'xlf', '--i18n-locale', 'fr', '--i18n-missing-translation', 'error');
}
})
);
} }

View File

@ -1,48 +0,0 @@
import {
killAllProcesses,
waitForAnyProcessOutputToMatch,
execAndWaitForOutputToMatch,
} from '../../../utils/process';
import { appendToFile } from '../../../utils/fs';
import { getGlobalVariable } from '../../../utils/env';
import { request } from '../../../utils/http';
import { wait } from '../../../utils/utils';
const validBundleRegEx = /: Compiled successfully./;
export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack.
return;
if (process.platform.startsWith('win')) {
return Promise.resolve();
}
// Skip this in ejected tests.
if (getGlobalVariable('argv').eject) {
return Promise.resolve();
}
return execAndWaitForOutputToMatch('ng', ['serve', '--aot'], validBundleRegEx)
// Wait before editing a file.
// Editing too soon seems to trigger a rebuild and throw polling/watch out of whack.
.then(() => wait(2000))
// Check AOT templates are up to date with current code.
.then(() => request('http://localhost:4200/main.js'))
.then((body) => {
if (body.match(/\$\$_E2E_GOLDEN_VALUE_1/)) {
throw new Error('Expected golden value 1 to not be present.');
}
})
.then(() => appendToFile('src/app/app.component.html', '<p> $$_E2E_GOLDEN_VALUE_1 </p>'))
.then(() => waitForAnyProcessOutputToMatch(validBundleRegEx, 20000))
.then(() => request('http://localhost:4200/main.js'))
.then((body) => {
if (!body.match(/\$\$_E2E_GOLDEN_VALUE_1/)) {
throw new Error('Expected golden value 1.');
}
})
.then(() => killAllProcesses(), (err: any) => {
killAllProcesses();
throw err;
});
}

View File

@ -1,38 +0,0 @@
import { ng } from '../../../utils/process';
import { writeFile, moveFile } from '../../../utils/fs';
import { updateJsonFile } from '../../../utils/project';
import { getGlobalVariable } from '../../../utils/env';
export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack.
return;
// Disable parts of it in webpack tests.
const ejected = getGlobalVariable('argv').eject;
// This test is only for Angular 2/4 projects.
if (!getGlobalVariable('argv').ng2 && !getGlobalVariable('argv').ng4) {
return Promise.resolve();
}
// Check if **/*.spec.ts files are excluded by default.
return Promise.resolve()
// This import would cause aot to fail.
.then(() => writeFile('src/another.component.spec.ts', `
import { BrowserDynamicTestingModule } from '@angular/platform-browser-dynamic/testing';
`))
.then(() => ng('build', '--aot'))
// Verify backwards compatibility with old project using the shared tsconfig.
.then(() => moveFile('src/tsconfig.app.json', 'src/tsconfig.json'))
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson['apps'][0];
app.tsconfig = 'tsconfig.json';
delete app['testTsconfig'];
}))
.then(() => updateJsonFile('src/tsconfig.json', tsconfigJson => {
delete tsconfigJson['exclude'];
delete tsconfigJson['compilerOptions']['types'];
}))
.then(() => ng('build', '--aot'))
.then(() => !ejected && ng('test', '--watch=false'));
}

View File

@ -1,21 +1,10 @@
import { ng } from '../../utils/process'; import { ng } from '../../utils/process';
import { expectFileToMatch, replaceInFile } from '../../utils/fs'; import { expectFileToMatch } from '../../utils/fs';
import { updateJsonFile } from '../../utils/project';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return ng('build', '--base-href', '/myUrl') return ng('build', '--base-href', '/myUrl')
.then(() => expectFileToMatch('dist/index.html', /<base href="\/myUrl">/))
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['baseHref'] = '/myUrl';
}))
.then(() => ng('build'))
.then(() => expectFileToMatch('dist/index.html', /<base href="\/myUrl">/))
.then(() => replaceInFile('src/index.html', 'href="/"', 'href=""'))
.then(() => ng('build'))
.then(() => expectFileToMatch('dist/index.html', /<base href="\/myUrl">/)); .then(() => expectFileToMatch('dist/index.html', /<base href="\/myUrl">/));
} }

View File

@ -12,8 +12,7 @@ const extraErrors = [
]; ];
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
if (process.platform.startsWith('win')) { if (process.platform.startsWith('win')) {
return Promise.resolve(); return Promise.resolve();

View File

@ -4,12 +4,11 @@ import { expectToFail } from '../../utils/utils';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return ng('build', '--aot', '--build-optimizer') return ng('build', '--aot', '--build-optimizer')
.then(() => expectToFail(() => expectFileToMatch('dist/main.js', /\.decorators =/))) .then(() => expectToFail(() => expectFileToMatch('dist/main.js', /\.decorators =/)))
.then(() => ng('build', '--optimization-level', '1')) .then(() => ng('build', '--prod'))
.then(() => expectToFail(() => expectFileToExist('dist/vendor.js'))) .then(() => expectToFail(() => expectFileToExist('dist/vendor.js')))
.then(() => expectToFail(() => expectFileToMatch('dist/main.js', /\.decorators =/))); .then(() => expectToFail(() => expectFileToMatch('dist/main.js', /\.decorators =/)));
} }

View File

@ -42,7 +42,7 @@ function validateHashes(
} }
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return; return;
let oldHashes: Map<string, string>; let oldHashes: Map<string, string>;

View File

@ -15,8 +15,7 @@ const imgSvg = `
`; `;
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
// Verify absolute/relative paths in global/component css. // Verify absolute/relative paths in global/component css.
@ -41,16 +40,16 @@ export default function () {
.then(() => expectFileToMatch('dist/styles.css', .then(() => expectFileToMatch('dist/styles.css',
/url\('\/assets\/global-img-absolute\.svg'\)/)) /url\('\/assets\/global-img-absolute\.svg'\)/))
.then(() => expectFileToMatch('dist/styles.css', .then(() => expectFileToMatch('dist/styles.css',
/global-img-relative\.[0-9a-f]{20}\.png/)) /global-img-relative\.png/))
.then(() => expectFileToMatch('dist/main.js', .then(() => expectFileToMatch('dist/main.js',
'/assets/component-img-absolute.svg')) '/assets/component-img-absolute.svg'))
.then(() => expectFileToMatch('dist/main.js', .then(() => expectFileToMatch('dist/main.js',
/component-img-relative\.[0-9a-f]{20}\.png/)) /component-img-relative\.png/))
// Check files are correctly created. // Check files are correctly created.
.then(() => expectToFail(() => expectFileToExist('dist/global-img-absolute.svg'))) .then(() => expectToFail(() => expectFileToExist('dist/global-img-absolute.svg')))
.then(() => expectToFail(() => expectFileToExist('dist/component-img-absolute.svg'))) .then(() => expectToFail(() => expectFileToExist('dist/component-img-absolute.svg')))
.then(() => expectFileMatchToExist('./dist', /global-img-relative\.[0-9a-f]{20}\.png/)) .then(() => expectFileMatchToExist('./dist', /global-img-relative\.png/))
.then(() => expectFileMatchToExist('./dist', /component-img-relative\.[0-9a-f]{20}\.png/)) .then(() => expectFileMatchToExist('./dist', /component-img-relative\.png/))
// Check urls with deploy-url scheme are used as is. // Check urls with deploy-url scheme are used as is.
.then(() => ng('build', '--base-href=/base/', '--deploy-url=http://deploy.url/', .then(() => ng('build', '--base-href=/base/', '--deploy-url=http://deploy.url/',
'--extract-css')) '--extract-css'))
@ -78,31 +77,31 @@ export default function () {
.then(() => expectFileToMatch('dist/styles.css', .then(() => expectFileToMatch('dist/styles.css',
'/base/deploy/assets/global-img-absolute.svg')) '/base/deploy/assets/global-img-absolute.svg'))
.then(() => expectFileToMatch('dist/styles.css', .then(() => expectFileToMatch('dist/styles.css',
/global-img-relative\.[0-9a-f]{20}\.png/)) /global-img-relative\.png/))
.then(() => expectFileToMatch('dist/main.js', .then(() => expectFileToMatch('dist/main.js',
'/base/deploy/assets/component-img-absolute.svg')) '/base/deploy/assets/component-img-absolute.svg'))
.then(() => expectFileToMatch('dist/main.js', .then(() => expectFileToMatch('dist/main.js',
/deploy\/component-img-relative\.[0-9a-f]{20}\.png/)) /deploy\/component-img-relative\.png/))
// Check with identical base-href and deploy-url flags. // Check with identical base-href and deploy-url flags.
.then(() => ng('build', '--base-href=/base/', '--deploy-url=/base/', .then(() => ng('build', '--base-href=/base/', '--deploy-url=/base/',
'--extract-css', '--aot')) '--extract-css', '--aot'))
.then(() => expectFileToMatch('dist/styles.css', .then(() => expectFileToMatch('dist/styles.css',
'/base/assets/global-img-absolute.svg')) '/base/assets/global-img-absolute.svg'))
.then(() => expectFileToMatch('dist/styles.css', .then(() => expectFileToMatch('dist/styles.css',
/global-img-relative\.[0-9a-f]{20}\.png/)) /global-img-relative\.png/))
.then(() => expectFileToMatch('dist/main.js', .then(() => expectFileToMatch('dist/main.js',
'/base/assets/component-img-absolute.svg')) '/base/assets/component-img-absolute.svg'))
.then(() => expectFileToMatch('dist/main.js', .then(() => expectFileToMatch('dist/main.js',
/\/base\/component-img-relative\.[0-9a-f]{20}\.png/)) /\/base\/component-img-relative\.png/))
// Check with only base-href flag. // Check with only base-href flag.
.then(() => ng('build', '--base-href=/base/', .then(() => ng('build', '--base-href=/base/',
'--extract-css', '--aot')) '--extract-css', '--aot'))
.then(() => expectFileToMatch('dist/styles.css', .then(() => expectFileToMatch('dist/styles.css',
'/base/assets/global-img-absolute.svg')) '/base/assets/global-img-absolute.svg'))
.then(() => expectFileToMatch('dist/styles.css', .then(() => expectFileToMatch('dist/styles.css',
/global-img-relative\.[0-9a-f]{20}\.png/)) /global-img-relative\.png/))
.then(() => expectFileToMatch('dist/main.js', .then(() => expectFileToMatch('dist/main.js',
'/base/assets/component-img-absolute.svg')) '/base/assets/component-img-absolute.svg'))
.then(() => expectFileToMatch('dist/main.js', .then(() => expectFileToMatch('dist/main.js',
/component-img-relative\.[0-9a-f]{20}\.png/)); /component-img-relative\.png/));
} }

View File

@ -4,8 +4,7 @@ import {deleteFile, expectFileToExist} from '../../utils/fs';
import {getGlobalVariable} from '../../utils/env'; import {getGlobalVariable} from '../../utils/env';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
// Skip this in ejected tests. // Skip this in ejected tests.
if (getGlobalVariable('argv').eject) { if (getGlobalVariable('argv').eject) {
@ -16,7 +15,7 @@ export default function() {
// This is supposed to fail since there's a missing file // This is supposed to fail since there's a missing file
.then(() => deleteFile('src/app/app.component.ts')) .then(() => deleteFile('src/app/app.component.ts'))
// The build fails but we don't delete the output of the previous build. // The build fails but we don't delete the output of the previous build.
.then(() => expectToFail(() => ng('build', '--no-delete-output-path'))) .then(() => expectToFail(() => ng('build', '--delete-output-path=false')))
.then(() => expectFileToExist('dist')) .then(() => expectFileToExist('dist'))
// By default, output path is always cleared. // By default, output path is always cleared.
.then(() => expectToFail(() => ng('build'))) .then(() => expectToFail(() => ng('build')))

View File

@ -6,8 +6,7 @@ import { getGlobalVariable } from '../../utils/env';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
.then(() => writeMultipleFiles({ .then(() => writeMultipleFiles({
@ -19,26 +18,19 @@ export default function () {
.then(() => expectFileToMatch('dist/index.html', 'deployUrl/main.js')) .then(() => expectFileToMatch('dist/index.html', 'deployUrl/main.js'))
// verify --deploy-url isn't applied to extracted css urls // verify --deploy-url isn't applied to extracted css urls
.then(() => expectFileToMatch('dist/styles.css', .then(() => expectFileToMatch('dist/styles.css',
/url\(['"]?more\.[0-9a-f]{20}\.png['"]?\)/)) /url\(['"]?more\.png['"]?\)/))
.then(() => ng('build', '--deploy-url=http://example.com/some/path/', '--extract-css')) .then(() => ng('build', '--deploy-url=http://example.com/some/path/', '--extract-css'))
.then(() => expectFileToMatch('dist/index.html', 'http://example.com/some/path/main.js')) .then(() => expectFileToMatch('dist/index.html', 'http://example.com/some/path/main.js'))
// verify option also works in config
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['deployUrl'] = 'config-deployUrl/';
}))
.then(() => ng('build'))
.then(() => expectFileToMatch('dist/index.html', 'config-deployUrl/main.js'))
// verify --deploy-url is applied to non-extracted css urls // verify --deploy-url is applied to non-extracted css urls
.then(() => ng('build', '--deploy-url=deployUrl/', '--extract-css=false')) .then(() => ng('build', '--deploy-url=deployUrl/', '--extract-css=false'))
.then(() => expectFileToMatch('dist/styles.js', .then(() => expectFileToMatch('dist/styles.js',
/\(['"]?deployUrl\/more\.[0-9a-f]{20}\.png['"]?\)/)) /\(['"]?deployUrl\/more\.png['"]?\)/))
.then(() => expectFileToMatch('dist/runtime.js', .then(() => expectFileToMatch('dist/runtime.js',
/__webpack_require__\.p = "deployUrl\/";/)) /__webpack_require__\.p = "deployUrl\/";/))
// verify slash is appended to the end of --deploy-url if missing // // verify slash is appended to the end of --deploy-url if missing
.then(() => ng('build', '--deploy-url=deployUrl', '--extract-css=false')) // .then(() => ng('build', '--deploy-url=deployUrl', '--extract-css=false'))
// skip this in ejected tests // // skip this in ejected tests
.then(() => getGlobalVariable('argv').eject // .then(() => getGlobalVariable('argv').eject
? Promise.resolve() // ? Promise.resolve()
: expectFileToMatch('dist/runtime.js', /__webpack_require__\.p = "deployUrl\/";/)); // : expectFileToMatch('dist/runtime.js', /__webpack_require__\.p = "deployUrl\/";/));
} }

View File

@ -5,7 +5,7 @@ import { updateJsonFile } from '../../utils/project';
export default async function() { export default async function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): lazyModules is not yet handled by the compat layer.
return; return;
// Add a lazy module // Add a lazy module

View File

@ -3,7 +3,7 @@ import {getGlobalVariable} from '../../utils/env';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Dev-server does not yet do this. Fix, reenable, validate, then delete this test.
return; return;
// Skip this in ejected tests. // Skip this in ejected tests.

View File

@ -4,8 +4,7 @@ import {expectToFail} from '../../utils/utils';
import {ng} from '../../utils/process'; import {ng} from '../../utils/process';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return ng('build', '--prod', '--extract-licenses=false') return ng('build', '--prod', '--extract-licenses=false')
.then(() => expectFileToExist(join(process.cwd(), 'dist'))) .then(() => expectFileToExist(join(process.cwd(), 'dist')))

View File

@ -1,20 +0,0 @@
import {ng} from '../../utils/process';
import {expectFileToExist} from '../../utils/fs';
import {updateJsonFile} from '../../utils/project';
import {copyFile} from '../../utils/fs';
export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve()
.then(() => copyFile('src/index.html', 'src/config-index.html'))
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson['apps'][0];
app['outDir'] = 'config-build-output';
app['index'] = 'config-index.html';
}))
.then(() => ng('build'))
.then(() => expectFileToExist('./config-build-output/config-index.html'));
}

View File

@ -5,8 +5,7 @@ import {getGlobalVariable} from '../../utils/env';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
// Skip this in ejected tests. // Skip this in ejected tests.
if (getGlobalVariable('argv').eject) { if (getGlobalVariable('argv').eject) {

View File

@ -3,8 +3,7 @@ import { ng } from '../../utils/process';
export default async function() { export default async function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
const mainTs = await readFile('src/main.ts'); const mainTs = await readFile('src/main.ts');

View File

@ -7,15 +7,14 @@ import {expectToFail} from '../../utils/utils';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
// Skip this in ejected tests. // Skip this in ejected tests.
if (getGlobalVariable('argv').eject) { if (getGlobalVariable('argv').eject) {
return Promise.resolve(); return Promise.resolve();
} }
return ng('build', '--output-path', './build-output') return ng('build', '--output-path', '../build-output')
.then(() => expectFileToExist('./build-output/index.html')) .then(() => expectFileToExist('./build-output/index.html'))
.then(() => expectFileToExist('./build-output/main.js')) .then(() => expectFileToExist('./build-output/main.js'))
.then(() => expectToFail(expectGitToBeClean)) .then(() => expectToFail(expectGitToBeClean))

View File

@ -9,8 +9,7 @@ function verifyMedia(css: RegExp, content: RegExp) {
} }
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
.then(() => writeMultipleFiles({ .then(() => writeMultipleFiles({

View File

@ -9,7 +9,8 @@ import {expectToFail, wait} from '../../utils/utils';
const webpackGoodRegEx = /: Compiled successfully./; const webpackGoodRegEx = /: Compiled successfully./;
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): This test is behaving oddly both here and in devkit/build-webpack.
// It seems to be because of file watchers.
return; return;
@ -22,7 +23,7 @@ export default function() {
} }
return execAndWaitForOutputToMatch('ng', ['serve', '--poll=10000'], webpackGoodRegEx) return execAndWaitForOutputToMatch('ng', ['build', '--watch', '--poll=10000'], webpackGoodRegEx)
// Wait before editing a file. // Wait before editing a file.
// Editing too soon seems to trigger a rebuild and throw polling out of whack. // Editing too soon seems to trigger a rebuild and throw polling out of whack.
.then(() => wait(3000)) .then(() => wait(3000))

View File

@ -3,8 +3,7 @@ import { ng } from '../../utils/process';
import { oneLineTrim } from 'common-tags'; import { oneLineTrim } from 'common-tags';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
.then(() => ng('build')) .then(() => ng('build'))

View File

@ -7,15 +7,14 @@ import {getGlobalVariable} from '../../utils/env';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
// Skip this in ejected tests. // Skip this in ejected tests.
const ejected = getGlobalVariable('argv').eject; const ejected = getGlobalVariable('argv').eject;
// Can't use the `ng` helper because somewhere the environment gets // Can't use the `ng` helper because somewhere the environment gets
// stuck to the first build done // stuck to the first build done
return ng('build', '--optimization-level', '1') return ng('build', '--prod')
.then(() => expectFileToExist(join(process.cwd(), 'dist'))) .then(() => expectFileToExist(join(process.cwd(), 'dist')))
// Check for cache busting hash script src // Check for cache busting hash script src
.then(() => expectFileToMatch('dist/index.html', /main\.[0-9a-f]{20}\.js/)) .then(() => expectFileToMatch('dist/index.html', /main\.[0-9a-f]{20}\.js/))

View File

@ -9,8 +9,7 @@ import {getGlobalVariable} from '../../utils/env';
const webpackGoodRegEx = /: Compiled successfully./; const webpackGoodRegEx = /: Compiled successfully./;
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
if (process.platform.startsWith('win')) { if (process.platform.startsWith('win')) {
return Promise.resolve(); return Promise.resolve();

View File

@ -13,8 +13,7 @@ const errorRe = /ERROR in/;
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
if (process.platform.startsWith('win')) { if (process.platform.startsWith('win')) {
return Promise.resolve(); return Promise.resolve();

View File

@ -18,7 +18,8 @@ const extraErrors = [
]; ];
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): This test is behaving oddly both here and in devkit/build-webpack.
// It seems to be because of file watchers.
return; return;
if (process.platform.startsWith('win')) { if (process.platform.startsWith('win')) {
@ -43,7 +44,7 @@ export default function () {
// Add a major static analysis error on a non-main file to the initial build. // Add a major static analysis error on a non-main file to the initial build.
.then(() => replaceInFile('./src/app/app.component.ts', `'app-root'`, `(() => 'app-root')()`)) .then(() => replaceInFile('./src/app/app.component.ts', `'app-root'`, `(() => 'app-root')()`))
// Should have an error. // Should have an error.
.then(() => execAndWaitForOutputToMatch('ng', ['serve', '--aot'], failedRe)) .then(() => execAndWaitForOutputToMatch('ng', ['build', '--watch', '--aot'], failedRe))
.then((results) => { .then((results) => {
const stderr = results.stderr; const stderr = results.stderr;
if (!stderr.includes('Function calls are not supported') if (!stderr.includes('Function calls are not supported')

View File

@ -3,14 +3,14 @@ import {
waitForAnyProcessOutputToMatch, waitForAnyProcessOutputToMatch,
execAndWaitForOutputToMatch, execAndWaitForOutputToMatch,
} from '../../utils/process'; } from '../../utils/process';
import { appendToFile, writeMultipleFiles, replaceInFile } from '../../utils/fs'; import { appendToFile, writeMultipleFiles, replaceInFile, expectFileToMatch } from '../../utils/fs';
import { request } from '../../utils/http';
import { getGlobalVariable } from '../../utils/env'; import { getGlobalVariable } from '../../utils/env';
const validBundleRegEx = /: Compiled successfully./; const validBundleRegEx = /: Compiled successfully./;
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): This test is behaving oddly both here and in devkit/build-webpack.
// It seems to be because of file watchers.
return; return;
if (process.platform.startsWith('win')) { if (process.platform.startsWith('win')) {
@ -26,7 +26,7 @@ export default function () {
return Promise.resolve(); return Promise.resolve();
} }
return execAndWaitForOutputToMatch('ng', ['serve', '--aot'], validBundleRegEx) return execAndWaitForOutputToMatch('ng', ['build', '--watch', '--aot'], validBundleRegEx)
.then(() => writeMultipleFiles({ .then(() => writeMultipleFiles({
'src/app/app.component.css': ` 'src/app/app.component.css': `
@import './imported-styles.css'; @import './imported-styles.css';
@ -49,53 +49,24 @@ export default function () {
waitForAnyProcessOutputToMatch(validBundleRegEx, 10000), waitForAnyProcessOutputToMatch(validBundleRegEx, 10000),
appendToFile('src/app/app.component.html', '<p>HTML_REBUILD_STRING<p>') appendToFile('src/app/app.component.html', '<p>HTML_REBUILD_STRING<p>')
])) ]))
.then(() => request('http://localhost:4200/main.js')) .then(() => expectFileToMatch('dist/main.js', 'HTML_REBUILD_STRING'))
.then((body) => {
if (!body.match(/HTML_REBUILD_STRING/)) {
throw new Error('Expected HTML_REBUILD_STRING but it wasn\'t in bundle.');
}
})
// Check if css changes are built. // Check if css changes are built.
.then(() => Promise.all([ .then(() => Promise.all([
waitForAnyProcessOutputToMatch(validBundleRegEx, 10000), waitForAnyProcessOutputToMatch(validBundleRegEx, 10000),
appendToFile('src/app/app.component.css', 'CSS_REBUILD_STRING {color: #f00;}') appendToFile('src/app/app.component.css', 'CSS_REBUILD_STRING {color: #f00;}')
])) ]))
.then(() => request('http://localhost:4200/main.js')) .then(() => expectFileToMatch('dist/main.js', 'CSS_REBUILD_STRING'))
.then((body) => {
if (!body.match(/CSS_REBUILD_STRING/)) {
throw new Error('Expected CSS_REBUILD_STRING but it wasn\'t in bundle.');
}
})
// Check if css dependency changes are built. // Check if css dependency changes are built.
.then(() => Promise.all([ .then(() => Promise.all([
waitForAnyProcessOutputToMatch(validBundleRegEx, 10000), waitForAnyProcessOutputToMatch(validBundleRegEx, 10000),
appendToFile('src/app/imported-styles.css', 'CSS_DEP_REBUILD_STRING {color: #f00;}') appendToFile('src/app/imported-styles.css', 'CSS_DEP_REBUILD_STRING {color: #f00;}')
])) ]))
.then(() => request('http://localhost:4200/main.js')) .then(() => expectFileToMatch('dist/main.js', 'CSS_DEP_REBUILD_STRING'))
.then((body) => {
if (!body.match(/CSS_DEP_REBUILD_STRING/)) {
throw new Error('Expected CSS_DEP_REBUILD_STRING but it wasn\'t in bundle.');
}
})
.then(() => {
// Skip this part of the test in Angular 2/4.
if (getGlobalVariable('argv').ng2 || getGlobalVariable('argv').ng4) {
return Promise.resolve();
}
// Check if component metadata changes are built.
return Promise.resolve()
.then(() => Promise.all([ .then(() => Promise.all([
waitForAnyProcessOutputToMatch(validBundleRegEx, 10000), waitForAnyProcessOutputToMatch(validBundleRegEx, 10000),
replaceInFile('src/app/app.component.ts', 'app-root', 'app-root-FACTORY_REBUILD_STRING') replaceInFile('src/app/app.component.ts', 'app-root', 'app-root-FACTORY_REBUILD_STRING')
])) ]))
.then(() => request('http://localhost:4200/main.js')) .then(() => expectFileToMatch('dist/main.js', 'FACTORY_REBUILD_STRING'))
.then((body) => {
if (!body.match(/FACTORY_REBUILD_STRING/)) {
throw new Error('Expected FACTORY_REBUILD_STRING but it wasn\'t in bundle.');
}
});
})
.then(() => killAllProcesses(), (err: any) => { .then(() => killAllProcesses(), (err: any) => {
killAllProcesses(); killAllProcesses();
throw err; throw err;

View File

@ -10,8 +10,7 @@ import {getGlobalVariable} from '../../utils/env';
const successRe = /: Compiled successfully/; const successRe = /: Compiled successfully/;
export default async function() { export default async function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
if (process.platform.startsWith('win')) { if (process.platform.startsWith('win')) {
return; return;

View File

@ -5,8 +5,7 @@ import { getGlobalVariable } from '../../utils/env';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
// Skip this test in Angular 2, it had different bundles. // Skip this test in Angular 2, it had different bundles.
if (getGlobalVariable('argv').ng2) { if (getGlobalVariable('argv').ng2) {

View File

@ -4,8 +4,7 @@ import {expectToFail} from '../../utils/utils';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return ng('build', '--source-map') return ng('build', '--source-map')
.then(() => expectFileToExist('dist/main.js.map')) .then(() => expectFileToExist('dist/main.js.map'))

View File

@ -3,8 +3,7 @@ import { ng } from '../../../utils/process';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
// Write assets. // Write assets.

View File

@ -9,8 +9,7 @@ import { expectToFail } from '../../../utils/utils';
import { oneLineTrim } from 'common-tags'; import { oneLineTrim } from 'common-tags';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
.then(() => writeMultipleFiles({ .then(() => writeMultipleFiles({

View File

@ -10,8 +10,7 @@ import { updateJsonFile } from '../../../utils/project';
import { getGlobalVariable } from '../../../utils/env'; import { getGlobalVariable } from '../../../utils/env';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
// Disable parts of it in webpack tests. // Disable parts of it in webpack tests.
const ejected = getGlobalVariable('argv').eject; const ejected = getGlobalVariable('argv').eject;

View File

@ -8,7 +8,7 @@ import { ng } from '../../../utils/process';
import { updateJsonFile } from '../../../utils/project'; import { updateJsonFile } from '../../../utils/project';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): The compat layer doesn't yet process `includePaths`.
return; return;
return Promise.resolve() return Promise.resolve()

View File

@ -16,8 +16,7 @@ const imgSvg = `
`; `;
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
.then(() => silentNpm('install', 'font-awesome@4.7.0')) .then(() => silentNpm('install', 'font-awesome@4.7.0'))
@ -50,17 +49,17 @@ export default function () {
}) })
// Check paths are correctly generated. // Check paths are correctly generated.
.then(() => expectFileToMatch('dist/styles.css', .then(() => expectFileToMatch('dist/styles.css',
/url\(['"]?large\.[0-9a-f]{20}\.png['"]?\),\s+linear-gradient\(to bottom, #0e40fa 25%, #0654f4 75%\);/)) /url\(['"]?large\.png['"]?\),\s+linear-gradient\(to bottom, #0e40fa 25%, #0654f4 75%\);/))
.then(() => expectFileToMatch('dist/styles.css', .then(() => expectFileToMatch('dist/styles.css',
/url\(\\?['"]data:image\/svg\+xml/)) /url\(\\?['"]data:image\/svg\+xml/))
.then(() => expectFileToMatch('dist/styles.css', .then(() => expectFileToMatch('dist/styles.css',
/url\(['"]?small-id\.[0-9a-f]{20}\.svg#testID['"]?\)/)) /url\(['"]?small-id\.svg#testID['"]?\)/))
.then(() => expectFileToMatch('dist/main.js', .then(() => expectFileToMatch('dist/main.js',
/url\(\\?['"]data:image\/svg\+xml/)) /url\(\\?['"]data:image\/svg\+xml/))
.then(() => expectFileToMatch('dist/main.js', .then(() => expectFileToMatch('dist/main.js',
/url\((?:['"]|\\')?large\.[0-9a-f]{20}\.png(?:['"]|\\')?\)/)) /url\((?:['"]|\\')?large\.png(?:['"]|\\')?\)/))
// Check files are correctly created. // Check files are correctly created.
.then(() => expectToFail(() => expectFileToExist('dist/small.svg'))) .then(() => expectToFail(() => expectFileToExist('dist/small.svg')))
.then(() => expectFileMatchToExist('./dist', /large\.[0-9a-f]{20}\.png/)) .then(() => expectFileMatchToExist('./dist', /large\.png/))
.then(() => expectFileMatchToExist('./dist', /small-id\.[0-9a-f]{20}\.svg/)); .then(() => expectFileMatchToExist('./dist', /small-id\.svg/));
} }

View File

@ -10,8 +10,7 @@ import { stripIndents } from 'common-tags';
import { updateJsonFile } from '../../../utils/project'; import { updateJsonFile } from '../../../utils/project';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return writeMultipleFiles({ return writeMultipleFiles({
'src/styles.less': stripIndents` 'src/styles.less': stripIndents`

View File

@ -10,8 +10,7 @@ import { updateJsonFile } from '../../../utils/project';
import { expectToFail } from '../../../utils/utils'; import { expectToFail } from '../../../utils/utils';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return writeMultipleFiles({ return writeMultipleFiles({
'src/styles.scss': stripIndents` 'src/styles.scss': stripIndents`

View File

@ -7,8 +7,7 @@ import { stripIndents } from 'common-tags';
import { updateJsonFile } from '../../../utils/project'; import { updateJsonFile } from '../../../utils/project';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
const extensions = ['css', 'scss', 'less', 'styl']; const extensions = ['css', 'scss', 'less', 'styl'];
let promise: Promise<any> = Promise.resolve() let promise: Promise<any> = Promise.resolve()

View File

@ -4,8 +4,7 @@ import { ng } from '../../../utils/process';
import { stripIndents } from 'common-tags'; import { stripIndents } from 'common-tags';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return writeFile('src/styles.css', stripIndents` return writeFile('src/styles.css', stripIndents`
/* normal-comment */ /* normal-comment */
@ -20,7 +19,7 @@ export default function () {
div { -webkit-box-flex: 1; -ms-flex: 1; flex: 1 } div { -webkit-box-flex: 1; -ms-flex: 1; flex: 1 }
`)) `))
// uses postcss-discard-comments plugin for prod // uses postcss-discard-comments plugin for prod
.then(() => ng('build', '--optimization-level', '1')) .then(() => ng('build', '--prod'))
.then(() => glob.sync('dist/styles.*.css').find(file => !!file)) .then(() => glob.sync('dist/styles.*.css').find(file => !!file))
.then((stylesBundle) => expectFileToMatch(stylesBundle, stripIndents` .then((stylesBundle) => expectFileToMatch(stylesBundle, stripIndents`
/*! important-comment */div{-webkit-box-flex:1;-ms-flex:1;flex:1} /*! important-comment */div{-webkit-box-flex:1;-ms-flex:1;flex:1}

View File

@ -10,8 +10,7 @@ import { stripIndents } from 'common-tags';
import { updateJsonFile } from '../../../utils/project'; import { updateJsonFile } from '../../../utils/project';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return writeMultipleFiles({ return writeMultipleFiles({
'src/styles.scss': stripIndents` 'src/styles.scss': stripIndents`

View File

@ -10,8 +10,7 @@ import { stripIndents } from 'common-tags';
import { updateJsonFile } from '../../../utils/project'; import { updateJsonFile } from '../../../utils/project';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return writeMultipleFiles({ return writeMultipleFiles({
'src/styles.styl': stripIndents` 'src/styles.styl': stripIndents`

View File

@ -5,8 +5,7 @@ import { expectToFail } from '../../utils/utils';
const integrityRe = /integrity="\w+-[A-Za-z0-9\/\+=]+"/; const integrityRe = /integrity="\w+-[A-Za-z0-9\/\+=]+"/;
export default async function() { export default async function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
// WEBPACK4_DISABLED - disabled pending a webpack 4 version // WEBPACK4_DISABLED - disabled pending a webpack 4 version
return; return;

View File

@ -5,8 +5,7 @@ import {stripIndents} from 'common-tags';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return updateTsConfig(json => { return updateTsConfig(json => {
json['compilerOptions']['baseUrl'] = './'; json['compilerOptions']['baseUrl'] = './';

View File

@ -4,11 +4,10 @@ import {expectToFail} from '../../utils/utils';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return ng('build') return ng('build')
.then(() => expectFileToExist('dist/vendor.js')) .then(() => expectFileToExist('dist/vendor.js'))
.then(() => ng('build', '--no-vendor-chunk')) .then(() => ng('build', '--vendor-chunk=false'))
.then(() => expectToFail(() => expectFileToExist('dist/vendor.js'))); .then(() => expectToFail(() => expectFileToExist('dist/vendor.js')));
} }

View File

@ -10,7 +10,8 @@ import { expectToFail } from '../../utils/utils';
const webpackGoodRegEx = /: Compiled successfully./; const webpackGoodRegEx = /: Compiled successfully./;
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): This test is behaving oddly both here and in devkit/build-webpack.
// It seems to be because of file watchers.
return; return;
if (process.platform.startsWith('win')) { if (process.platform.startsWith('win')) {

View File

@ -3,7 +3,7 @@ import {updateJsonFile} from '../../../utils/project';
import {expectToFail} from '../../../utils/utils'; import {expectToFail} from '../../../utils/utils';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): This isn't working correctly in devkit/build-webpack, due to module resolution.
return; return;
return Promise.resolve() return Promise.resolve()

View File

@ -3,8 +3,7 @@ import { killAllProcesses } from '../../../utils/process';
import { ngServe } from '../../../utils/project'; import { ngServe } from '../../../utils/project';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
.then(() => ngServe('--serve-path', 'test/')) .then(() => ngServe('--serve-path', 'test/'))
@ -21,12 +20,12 @@ export default function () {
} }
}) })
.then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; }) .then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; })
.then(() => ngServe('--base-href', 'test/')) // .then(() => ngServe('--base-href', 'test/'))
.then(() => request('http://localhost:4200/test')) // .then(() => request('http://localhost:4200/test'))
.then(body => { // .then(body => {
if (!body.match(/<app-root><\/app-root>/)) { // if (!body.match(/<app-root><\/app-root>/)) {
throw new Error('Response does not match expected value.'); // throw new Error('Response does not match expected value.');
} // }
}) // })
.then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; }); // .then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; });
} }

View File

@ -4,8 +4,7 @@ import { getGlobalVariable } from '../../utils/env';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
// Skip this test in Angular 2/4. // Skip this test in Angular 2/4.
if (getGlobalVariable('argv').ng2 || getGlobalVariable('argv').ng4) { if (getGlobalVariable('argv').ng2 || getGlobalVariable('argv').ng4) {

View File

@ -7,8 +7,7 @@ import {
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return ng('generate', 'component', 'i18n-test') return ng('generate', 'component', 'i18n-test')
.then(() => writeFile( .then(() => writeFile(

View File

@ -4,8 +4,7 @@ import { expectToFail } from '../../utils/utils';
import { join } from 'path'; import { join } from 'path';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return ng('generate', 'component', 'i18n-test') return ng('generate', 'component', 'i18n-test')
.then(() => writeFile( .then(() => writeFile(

View File

@ -4,8 +4,7 @@ import { writeFile, expectFileToMatch } from '../../utils/fs';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return ng('generate', 'component', 'i18n-test') return ng('generate', 'component', 'i18n-test')
.then(() => writeFile( .then(() => writeFile(

View File

@ -4,8 +4,7 @@ import { writeFile, expectFileToMatch } from '../../utils/fs';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return ng('generate', 'component', 'i18n-test') return ng('generate', 'component', 'i18n-test')
.then(() => writeFile( .then(() => writeFile(

View File

@ -7,8 +7,7 @@ import {
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return ng('generate', 'component', 'i18n-test') return ng('generate', 'component', 'i18n-test')
.then(() => writeFile( .then(() => writeFile(

View File

@ -2,7 +2,7 @@ import { ng } from '../../utils/process';
import { oneLine } from 'common-tags'; import { oneLine } from 'common-tags';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out how this test should look like post devkit/build-webpack.
return; return;
return Promise.resolve() return Promise.resolve()

View File

@ -5,7 +5,7 @@ import { oneLine } from 'common-tags';
import { updateJsonFile } from '../../utils/project'; import { updateJsonFile } from '../../utils/project';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out how this test should look like post devkit/build-webpack.
return; return;
return Promise.resolve() return Promise.resolve()

View File

@ -3,7 +3,7 @@ import { writeFile } from '../../utils/fs';
import { oneLine } from 'common-tags'; import { oneLine } from 'common-tags';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out how this test should look like post devkit/build-webpack.
return; return;
const fileName = 'src/app/foo.ts'; const fileName = 'src/app/foo.ts';

View File

@ -2,7 +2,7 @@ import { ng } from '../../utils/process';
import { readFile, writeFile } from '../../utils/fs'; import { readFile, writeFile } from '../../utils/fs';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out how this test should look like post devkit/build-webpack.
return; return;
const fileName = 'src/app/foo.ts'; const fileName = 'src/app/foo.ts';

View File

@ -3,7 +3,7 @@ import { writeFile } from '../../utils/fs';
import { oneLine } from 'common-tags'; import { oneLine } from 'common-tags';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out how this test should look like post devkit/build-webpack.
return; return;
const fileName = 'src/app/foo.ts'; const fileName = 'src/app/foo.ts';

View File

@ -3,7 +3,7 @@ import { writeFile } from '../../utils/fs';
import { oneLine } from 'common-tags'; import { oneLine } from 'common-tags';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out how this test should look like post devkit/build-webpack.
return; return;
const fileName = 'src/app/foo.ts'; const fileName = 'src/app/foo.ts';

View File

@ -3,7 +3,7 @@ import { writeFile } from '../../utils/fs';
import { oneLine } from 'common-tags'; import { oneLine } from 'common-tags';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out how this test should look like post devkit/build-webpack.
return; return;
const fileName = 'src/app/foo.ts'; const fileName = 'src/app/foo.ts';

View File

@ -4,7 +4,7 @@ import { expectToFail } from '../../utils/utils';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out how this test should look like post devkit/build-webpack.
return; return;
const fileName = 'src/app/foo/foo.ts'; const fileName = 'src/app/foo/foo.ts';

View File

@ -2,7 +2,7 @@ import { ng } from '../../utils/process';
import { expectToFail } from '../../utils/utils'; import { expectToFail } from '../../utils/utils';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out how this test should look like post devkit/build-webpack.
return; return;
return Promise.resolve() return Promise.resolve()

View File

@ -4,7 +4,7 @@ import { writeFile } from '../../utils/fs';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out how this test should look like post devkit/build-webpack.
return; return;
const fileName = 'src/app/foo.ts'; const fileName = 'src/app/foo.ts';

View File

@ -3,7 +3,7 @@ import { writeFile } from '../../utils/fs';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out how this test should look like post devkit/build-webpack.
return; return;
const fileName = 'src/app/foo.ts'; const fileName = 'src/app/foo.ts';

View File

@ -2,8 +2,7 @@ import { ng } from '../../utils/process';
import { oneLine } from 'common-tags'; import { oneLine } from 'common-tags';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return ng('lint') return ng('lint')
.then(({ stdout }) => { .then(({ stdout }) => {

View File

@ -5,8 +5,7 @@ import {expectToFail} from '../../utils/utils';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return writeFile('src/assets/.file', '') return writeFile('src/assets/.file', '')
.then(() => writeFile('src/assets/test.abc', 'hello world')) .then(() => writeFile('src/assets/test.abc', 'hello world'))

View File

@ -3,8 +3,7 @@ import { ng } from '../../utils/process';
export default async function () { export default async function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
await prependToFile('src/app/app.component.ts', await prependToFile('src/app/app.component.ts',
`import { AppModule } from './app.module'; console.log(AppModule);`); `import { AppModule } from './app.module'; console.log(AppModule);`);
@ -12,10 +11,4 @@ export default async function () {
if (!output.stdout.match(/WARNING in Circular dependency detected/)) { if (!output.stdout.match(/WARNING in Circular dependency detected/)) {
throw new Error('Expected to have circular dependency warning in output.'); throw new Error('Expected to have circular dependency warning in output.');
} }
await ng('config', 'defaults.build.showCircularDependencies', 'false');
output = await ng('build');
if (output.stdout.match(/WARNING in Circular dependency detected/)) {
throw new Error('Expected to not have circular dependency warning in output.');
}
} }

View File

@ -7,7 +7,8 @@ import {expectToFail} from '../../utils/utils';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): The common chunk seems to have a different name in devkit/build-webpack.
// Investigate, validate, then delete this test.
return; return;
return Promise.resolve(); return Promise.resolve();

View File

@ -5,7 +5,8 @@ import {ng} from '../../utils/process';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): This test is broken in devkit/build-webpack, istanbul and
// istanbul-instrumenter-loader are missing from the dependencies.
return; return;
return ng('test', '--watch=false', '--code-coverage') return ng('test', '--watch=false', '--code-coverage')

View File

@ -1,24 +0,0 @@
import { request } from '../../utils/http';
import { killAllProcesses } from '../../utils/process';
import { ngServe } from '../../utils/project';
import { updateJsonFile } from '../../utils/project';
export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve()
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson.defaults;
app.serve = { port: 4201 };
}))
.then(() => ngServe())
.then(() => request('http://localhost:4201/'))
.then(body => {
if (!body.match(/<app-root><\/app-root>/)) {
throw new Error('Response does not match expected value.');
}
})
.then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; });
}

View File

@ -1,37 +0,0 @@
import { killAllProcesses } from '../../utils/process';
import { request } from '../../utils/http';
import { ngServe, updateJsonFile } from '../../utils/project';
import { writeMultipleFiles } from '../../utils/fs';
export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve()
.then(() => writeMultipleFiles({
'src/string-script.js': 'console.log(\'string-script\'); var number = 1+1;',
})
.then(() => updateJsonFile('.angular-cli.json', configJson => {
configJson['apps'][0]['scripts'] = [
'string-script.js',
];
}))
// check when setup through command line arguments
.then(() => ngServe('--deploy-url', '/deployurl/', '--base-href', '/deployurl/'))
.then(() => request('http://localhost:4200'))
.then(body => {
if (!body.match(/<app-root><\/app-root>/)) {
throw new Error('Response does not match expected value. (1)');
}
if (!body.match(/"\/deployurl\/scripts.js"/)) {
throw new Error('Response does not match expected value. (2)');
}
})
.then(() => request('http://localhost:4200/deployurl/'))
.then(body => {
if (!body.match(/<app-root><\/app-root>/)) {
throw new Error('Response does not match expected value. (3)');
}
})
.then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; });
}

View File

@ -6,8 +6,7 @@ import { moveFile } from '../../utils/fs';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
// should fallback to config.app[0].index (index.html by default) // should fallback to config.app[0].index (index.html by default)
return Promise.resolve() return Promise.resolve()

View File

@ -5,8 +5,7 @@ import {appendToFile, writeFile, prependToFile, replaceInFile} from '../../utils
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
let oldNumberOfFiles = 0; let oldNumberOfFiles = 0;
return Promise.resolve() return Promise.resolve()

View File

@ -3,7 +3,7 @@ import { ng } from '../../utils/process';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out what a minimal config is for architect apps.
return; return;
return Promise.resolve() return Promise.resolve()

View File

@ -3,8 +3,7 @@ import { ng } from '../../utils/process';
export default async function () { export default async function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
await writeMultipleFiles({ await writeMultipleFiles({
'./src/app/foo.ts': ` './src/app/foo.ts': `

View File

@ -9,8 +9,7 @@ import {updateJsonFile} from '../../utils/project';
import {expectToFail} from "../../utils/utils"; import {expectToFail} from "../../utils/utils";
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
// Create an express app that serves as a proxy. // Create an express app that serves as a proxy.
const app = express(); const app = express();
@ -34,7 +33,7 @@ export default function() {
return Promise.resolve() return Promise.resolve()
.then(() => writeFile(proxyConfigFile, JSON.stringify(proxyConfig, null, 2))) .then(() => writeFile(proxyConfigFile, JSON.stringify(proxyConfig, null, 2)))
.then(() => ngServe('--proxy-config', proxyConfigFile)) .then(() => ngServe('--proxy-config', '../' + proxyConfigFile))
.then(() => request('http://localhost:4200/api/test')) .then(() => request('http://localhost:4200/api/test'))
.then(body => { .then(body => {
if (!body.match(/TEST_API_RETURN/)) { if (!body.match(/TEST_API_RETURN/)) {
@ -43,30 +42,30 @@ export default function() {
}) })
.then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; }) .then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; })
.then(() => updateJsonFile('.angular-cli.json', configJson => { // .then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson.defaults; // const app = configJson.defaults;
app.serve = { // app.serve = {
proxyConfig: proxyConfigFile // proxyConfig: proxyConfigFile
}; // };
})) // }))
.then(() => ngServe()) // .then(() => ngServe())
.then(() => request('http://localhost:4200/api/test')) // .then(() => request('http://localhost:4200/api/test'))
.then(body => { // .then(body => {
if (!body.match(/TEST_API_RETURN/)) { // if (!body.match(/TEST_API_RETURN/)) {
throw new Error('Response does not match expected value.'); // throw new Error('Response does not match expected value.');
} // }
}) // })
.then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; }) // .then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; })
.then(() => server.close(), (err) => { server.close(); throw err; }) .then(() => server.close(), (err) => { server.close(); throw err; })
// A non-existing proxy file should error. // // A non-existing proxy file should error.
.then(() => expectToFail(() => ng('serve', '--proxy-config', 'proxy.non-existent.json'))) // .then(() => expectToFail(() => ng('serve', '--proxy-config', 'proxy.non-existent.json')))
.then(() => updateJsonFile('.angular-cli.json', configJson => { // .then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson.defaults; // const app = configJson.defaults;
app.serve = { // app.serve = {
proxyConfig: 'proxy.non-existent.json' // proxyConfig: 'proxy.non-existent.json'
}; // };
})) // }))
.then(() => expectToFail(() => ng('serve'))); // .then(() => expectToFail(() => ng('serve')));
} }

View File

@ -6,8 +6,7 @@ import { killAllProcesses } from '../../utils/process';
import { ngServe } from '../../utils/project'; import { ngServe } from '../../utils/project';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
const firstLocalIp = _(os.networkInterfaces()) const firstLocalIp = _(os.networkInterfaces())
.values() .values()

View File

@ -1,24 +0,0 @@
import { request } from '../../utils/http';
import { killAllProcesses } from '../../utils/process';
import { ngServe } from '../../utils/project';
import { updateJsonFile } from '../../utils/project';
export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve()
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson.defaults;
app.serve = { ssl: true };
}))
.then(() => ngServe())
.then(() => request('https://localhost:4200/'))
.then(body => {
if (!body.match(/<app-root><\/app-root>/)) {
throw new Error('Response does not match expected value.');
}
})
.then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; });
}

View File

@ -4,8 +4,7 @@ import { ngServe } from '../../utils/project';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
.then(() => ngServe('--ssl', 'true')) .then(() => ngServe('--ssl', 'true'))

View File

@ -1,30 +0,0 @@
import { request } from '../../utils/http';
import { assetDir } from '../../utils/assets';
import { killAllProcesses } from '../../utils/process';
import { ngServe } from '../../utils/project';
import { updateJsonFile } from '../../utils/project';
export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve()
.then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson.defaults;
app.serve = {
ssl: true,
sslKey: assetDir('ssl/server.key'),
sslCert: assetDir('ssl/server.crt')
};
}))
.then(() => ngServe())
.then(() => request('https://localhost:4200/'))
.then(body => {
if (!body.match(/<app-root><\/app-root>/)) {
throw new Error('Response does not match expected value.');
}
})
.then(() => killAllProcesses(), (err) => { killAllProcesses(); throw err; });
}

View File

@ -5,8 +5,7 @@ import { ngServe } from '../../utils/project';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
.then(() => ngServe( .then(() => ngServe(

View File

@ -5,19 +5,18 @@ import { updateJsonFile } from '../../utils/project';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out why this test is not working.
return; return;
return Promise.resolve() return Promise.resolve()
.then(() => expectToFail(() => ng('e2e', '--no-serve'))) .then(() => expectToFail(() => ng('e2e', '--devServerTarget=')))
.then(() => updateJsonFile('.angular-cli.json', configJson => { .then(() => updateJsonFile('.angular-cli.json', configJson => {
const app = configJson.defaults; const app = configJson.defaults;
app.serve = { port: 4400 }; app.serve = { port: 4400 };
})) }))
.then(() => ngServe()) .then(() => ngServe())
.then(() => expectToFail(() => ng('e2e', '--no-serve'))) .then(() => ng('e2e', '--devServerTarget=', '--base-url=http://localhost:4400'))
.then(() => ng('e2e', '--no-serve', '--base-href=http://localhost:4400')) .then(() => ng('e2e', '--devServerTarget=', '--port=4400'))
.then(() => ng('e2e', '--no-serve', '--port=4400'))
.then(() => killAllProcesses(), (err: any) => { .then(() => killAllProcesses(), (err: any) => {
killAllProcesses(); killAllProcesses();
throw err; throw err;

View File

@ -6,7 +6,7 @@ import { stripIndent } from 'common-tags';
// Make sure asset files are served // Make sure asset files are served
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Figure out why this test is not working.
return; return;
return Promise.resolve() return Promise.resolve()

View File

@ -1,25 +0,0 @@
import { ng } from '../../utils/process';
import { replaceInFile } from '../../utils/fs';
export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack.
return;
// Old configs (with the cli preprocessor listed) should still supported.
return Promise.resolve()
.then(() => replaceInFile('karma.conf.js',
'coverageIstanbulReporter: {', `
files: [
{ pattern: './src/test.ts', watched: false }
],
preprocessors: {
'./src/test.ts': ['@angular/cli']
},
mime: {
'text/x-typescript': ['ts','tsx']
},
coverageIstanbulReporter: {
`))
.then(() => ng('test', '--watch=false'));
}

View File

@ -2,7 +2,7 @@ import { ng } from '../../utils/process';
import { writeFile } from '../../utils/fs'; import { writeFile } from '../../utils/fs';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): re-enable after build-webpack supports this functionality.
return; return;
// Tests run in 'dev' environment by default. // Tests run in 'dev' environment by default.

View File

@ -4,8 +4,7 @@ import { expectToFail } from '../../utils/utils';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
// Fails on single run with broken compilation. // Fails on single run with broken compilation.
return writeFile('src/app.component.spec.ts', '<p> definitely not typescript </p>') return writeFile('src/app.component.spec.ts', '<p> definitely not typescript </p>')

View File

@ -11,7 +11,8 @@ import { readFile, writeFile } from '../../utils/fs';
const karmaGoodRegEx = /Executed 3 of 3 SUCCESS \(\d+\.\d+ secs/; const karmaGoodRegEx = /Executed 3 of 3 SUCCESS \(\d+\.\d+ secs/;
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): This test is behaving oddly both here and in devkit/build-webpack.
// It seems to be because of file watchers.
return; return;
let originalSpec: string; let originalSpec: string;

View File

@ -6,8 +6,7 @@ import { stripIndent } from 'common-tags';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
.then(() => ng('test', '--watch=false')) .then(() => ng('test', '--watch=false'))

View File

@ -2,7 +2,8 @@ import { ng } from '../../utils/process';
import { updateJsonFile } from '../../utils/project'; import { updateJsonFile } from '../../utils/project';
export default function () { export default function () {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): This is giving odd errors in devkit/build-webpack.
// TypeError: Assignment to constant variable.
return; return;
return updateJsonFile('tsconfig.json', configJson => { return updateJsonFile('tsconfig.json', configJson => {

View File

@ -5,8 +5,7 @@ import {oneLineTrim} from 'common-tags';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
.then(() => silentNpm('install', 'bootstrap@4.0.0-beta.3')) .then(() => silentNpm('install', 'bootstrap@4.0.0-beta.3'))
@ -29,9 +28,10 @@ export default function() {
`)) `))
.then(() => ng( .then(() => ng(
'build', 'build',
'--optimization-level', '1', '--optimization-level=1',
'--extract-css', '--extract-css',
'--output-hashing=none' '--output-hashing=none',
'--vendor-chunk=false',
)) ))
.then(() => expectFileToMatch('dist/scripts.js', 'jQuery')) .then(() => expectFileToMatch('dist/scripts.js', 'jQuery'))
.then(() => expectFileToMatch('dist/styles.css', '* Bootstrap')) .then(() => expectFileToMatch('dist/styles.css', '* Bootstrap'))

View File

@ -4,8 +4,7 @@ import {expectFileToMatch} from '../../utils/fs';
export default function() { export default function() {
// TODO(architect): reenable, validate, then delete this test. It is now in devkit/build-webpack. // TODO(architect): Delete this test. It is now in devkit/build-webpack.
return;
return Promise.resolve() return Promise.resolve()
.then(() => silentNpm('install', 'material-design-icons@3.0.1')) .then(() => silentNpm('install', 'material-design-icons@3.0.1'))