File tree Expand file tree Collapse file tree 6 files changed +36
-0
lines changed
packages/@angular/cli/tasks Expand file tree Collapse file tree 6 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { stripIndents } from 'common-tags';
44import { E2eTaskOptions } from '../commands/e2e' ;
55import { CliConfig } from '../models/config' ;
66import { requireProjectModule } from '../utilities/require-project-module' ;
7+ import { getAppFromConfig } from '../utilities/app-utils' ;
78
89const Task = require ( '../ember-cli/lib/models/task' ) ;
910const SilentError = require ( 'silent-error' ) ;
@@ -14,10 +15,14 @@ export const E2eTask = Task.extend({
1415 const projectConfig = CliConfig . fromProject ( ) . config ;
1516 const projectRoot = this . project . root ;
1617 const protractorLauncher = requireProjectModule ( projectRoot , 'protractor/built/launcher' ) ;
18+ const appConfig = getAppFromConfig ( e2eTaskOptions . app ) ;
1719
1820 if ( projectConfig . project && projectConfig . project . ejected ) {
1921 throw new SilentError ( 'An ejected project cannot use the build command anymore.' ) ;
2022 }
23+ if ( appConfig . platform === 'server' ) {
24+ throw new SilentError ( 'ng test for platform server applications is coming soon!' ) ;
25+ }
2126
2227 return new Promise ( function ( ) {
2328 let promise = Promise . resolve ( ) ;
Original file line number Diff line number Diff line change @@ -436,6 +436,9 @@ export default Task.extend({
436436 if ( project . root === path . resolve ( outputPath ) ) {
437437 throw new SilentError ( 'Output path MUST not be project root directory!' ) ;
438438 }
439+ if ( appConfig . platform && appConfig . platform === 'server' ) {
440+ throw new SilentError ( 'ng eject for platform server applications is coming soon!' ) ;
441+ }
439442
440443 const webpackConfig = new NgCliWebpackConfig ( runTaskOptions , appConfig ) . buildConfig ( ) ;
441444 const serializer = new JsonWebpackSerializer ( process . cwd ( ) , outputPath , appConfig . root ) ;
Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ export default Task.extend({
3131 if ( projectConfig . project && projectConfig . project . ejected ) {
3232 throw new SilentError ( 'An ejected project cannot use the build command anymore.' ) ;
3333 }
34+ if ( appConfig . platform === 'server' ) {
35+ throw new SilentError ( 'ng serve for platform server applications is coming soon!' ) ;
36+ }
3437 if ( serveTaskOptions . deleteOutputPath ) {
3538 fs . removeSync ( path . resolve ( this . project . root , outputPath ) ) ;
3639 }
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as path from 'path';
33import { TestOptions } from '../commands/test' ;
44import { CliConfig } from '../models/config' ;
55import { requireProjectModule } from '../utilities/require-project-module' ;
6+ import { getAppFromConfig } from '../utilities/app-utils' ;
67
78const Task = require ( '../ember-cli/lib/models/task' ) ;
89const SilentError = require ( 'silent-error' ) ;
@@ -12,10 +13,14 @@ export default Task.extend({
1213 run : function ( options : TestOptions ) {
1314 const projectConfig = CliConfig . fromProject ( ) . config ;
1415 const projectRoot = this . project . root ;
16+ const appConfig = getAppFromConfig ( options . app ) ;
1517
1618 if ( projectConfig . project && projectConfig . project . ejected ) {
1719 throw new SilentError ( 'An ejected project cannot use the build command anymore.' ) ;
1820 }
21+ if ( appConfig . platform === 'server' ) {
22+ throw new SilentError ( 'ng test for platform server applications is coming soon!' ) ;
23+ }
1924
2025 return new Promise ( ( resolve ) => {
2126 const karma = requireProjectModule ( projectRoot , 'karma' ) ;
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ export default function () {
1111 return Promise . resolve ( ) ;
1212 }
1313
14+ // Skip this for ejected tests.
15+ if ( getGlobalVariable ( 'argv' ) . eject ) {
16+ return Promise . resolve ( ) ;
17+ }
18+
1419 return Promise . resolve ( )
1520 . then ( ( ) => updateJsonFile ( '.angular-cli.json' , configJson => {
1621 const app = configJson [ 'apps' ] [ 0 ] ;
Original file line number Diff line number Diff line change 1+ import { ng } from '../../utils/process' ;
2+ import { updateJsonFile } from '../../utils/project' ;
3+ import { expectToFail } from '../../utils/utils' ;
4+
5+ export default function ( ) {
6+ return Promise . resolve ( )
7+ . then ( ( ) => updateJsonFile ( '.angular-cli.json' , configJson => {
8+ const app = configJson [ 'apps' ] [ 0 ] ;
9+ app [ 'platform' ] = 'server' ;
10+ } ) )
11+ . then ( ( ) => expectToFail ( ( ) => ng ( 'serve' ) ) )
12+ . then ( ( ) => expectToFail ( ( ) => ng ( 'test' ) ) )
13+ . then ( ( ) => expectToFail ( ( ) => ng ( 'e2e' ) ) )
14+ . then ( ( ) => expectToFail ( ( ) => ng ( 'eject' ) ) ) ;
15+ }
You can’t perform that action at this time.
0 commit comments