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 {
3939
4040 const assetPath = join ( project . root as Path , 'src' , 'assets' ) ;
4141
42+ options . title = options . title || options . project ;
43+
4244 const tempalteSource = apply ( url ( './files/assets' ) , [
4345 template ( {
4446 ...options ,
Original file line number Diff line number Diff line change @@ -77,4 +77,13 @@ describe('PWA Schematic', () => {
7777 expect ( manifest . name ) . toEqual ( defaultOptions . title ) ;
7878 expect ( manifest . short_name ) . toEqual ( defaultOptions . title ) ;
7979 } ) ;
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+ } ) ;
8089} ) ;
You can’t perform that action at this time.
0 commit comments