1
+ import * as path from 'path' ;
1
2
import {
2
3
writeMultipleFiles ,
3
4
createDir ,
@@ -10,6 +11,10 @@ import { expectToFail } from '../../utils/utils';
10
11
import { getGlobalVariable } from '../../utils/env' ;
11
12
12
13
14
+ const temp = require ( 'temp' ) ;
15
+ const tempDir = path . join ( temp . mkdirSync ( 'angular-cli-e2e-assets-' ) , 'out' ) ;
16
+
17
+
13
18
export default function ( ) {
14
19
// Disable parts of it in webpack tests.
15
20
const ejected = getGlobalVariable ( 'argv' ) . eject ;
@@ -55,6 +60,21 @@ export default function () {
55
60
} ) )
56
61
. then ( ( ) => expectToFail ( ( ) => ng ( 'build' ) ) )
57
62
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
+
58
78
// This asset should also fail from reading from outside the project.
59
79
. then ( ( ) => updateJsonFile ( '.angular-cli.json' , configJson => {
60
80
const app = configJson [ 'apps' ] [ 0 ] ;
0 commit comments