File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ export default function (options: PwaOptions): Rule {
39
39
40
40
const assetPath = join ( project . root as Path , 'src' , 'assets' ) ;
41
41
42
+ options . title = options . title || options . project ;
43
+
42
44
const tempalteSource = apply ( url ( './files/assets' ) , [
43
45
template ( {
44
46
...options ,
Original file line number Diff line number Diff line change @@ -77,4 +77,13 @@ describe('PWA Schematic', () => {
77
77
expect ( manifest . name ) . toEqual ( defaultOptions . title ) ;
78
78
expect ( manifest . short_name ) . toEqual ( defaultOptions . title ) ;
79
79
} ) ;
80
+
81
+ it ( 'should set the name & short_name in the manifest file when no title provided' , ( ) => {
82
+ const options = { ...defaultOptions , title : undefined } ;
83
+ const tree = schematicRunner . runSchematic ( 'ng-add' , options , appTree ) ;
84
+ const manifestText = tree . readContent ( '/projects/bar/src/assets/manifest.json' ) ;
85
+ const manifest = JSON . parse ( manifestText ) ;
86
+ expect ( manifest . name ) . toEqual ( defaultOptions . project ) ;
87
+ expect ( manifest . short_name ) . toEqual ( defaultOptions . project ) ;
88
+ } ) ;
80
89
} ) ;
You can’t perform that action at this time.
0 commit comments