1+ import * as path from 'path' ;
12import {
23 writeMultipleFiles ,
34 createDir ,
@@ -10,6 +11,10 @@ import { expectToFail } from '../../utils/utils';
1011import { getGlobalVariable } from '../../utils/env' ;
1112
1213
14+ const temp = require ( 'temp' ) ;
15+ const tempDir = path . join ( temp . mkdirSync ( 'angular-cli-e2e-assets-' ) , 'out' ) ;
16+
17+
1318export default function ( ) {
1419 // Disable parts of it in webpack tests.
1520 const ejected = getGlobalVariable ( 'argv' ) . eject ;
@@ -55,6 +60,21 @@ export default function () {
5560 } ) )
5661 . then ( ( ) => expectToFail ( ( ) => ng ( 'build' ) ) )
5762
63+ // This asset will not fail with the exception above.
64+ . then ( ( ) => updateJsonFile ( '.angular-cli.json' , configJson => {
65+ const app = configJson [ 'apps' ] [ 0 ] ;
66+ app [ 'outDir' ] = tempDir ;
67+ app [ 'assets' ] = [
68+ { 'glob' : '**/*' , 'input' : '../node_modules/some-package/' , 'output' : tempDir ,
69+ 'allowOutsideOutDir' : true }
70+ ] ;
71+ } ) )
72+ . then ( ( ) => ng ( 'build' ) )
73+ . then ( ( ) => updateJsonFile ( '.angular-cli.json' , configJson => {
74+ const app = configJson [ 'apps' ] [ 0 ] ;
75+ app [ 'outDir' ] = 'dist' ;
76+ } )
77+
5878 // This asset should also fail from reading from outside the project.
5979 . then ( ( ) => updateJsonFile ( '.angular-cli.json' , configJson => {
6080 const app = configJson [ 'apps' ] [ 0 ] ;
0 commit comments