@@ -48,14 +48,14 @@ describe('Enum Schematic', () => {
4848 . runSchematicAsync ( 'enum' , defaultOptions , appTree )
4949 . toPromise ( ) ;
5050 const files = tree . files ;
51- expect ( files ) . toContain ( '/projects/bar/src/app/foo.enum. ts' ) ;
51+ expect ( files ) . toContain ( '/projects/bar/src/app/foo.ts' ) ;
5252 } ) ;
5353
5454 it ( 'should create an enumeration' , async ( ) => {
5555 const tree = await schematicRunner
5656 . runSchematicAsync ( 'enum' , defaultOptions , appTree )
5757 . toPromise ( ) ;
58- const content = tree . readContent ( '/projects/bar/src/app/foo.enum. ts' ) ;
58+ const content = tree . readContent ( '/projects/bar/src/app/foo.ts' ) ;
5959 expect ( content ) . toMatch ( 'export enum Foo {' ) ;
6060 } ) ;
6161
@@ -64,6 +64,13 @@ describe('Enum Schematic', () => {
6464 config . projects . bar . sourceRoot = 'projects/bar/custom' ;
6565 appTree . overwrite ( '/angular.json' , JSON . stringify ( config , null , 2 ) ) ;
6666 appTree = await schematicRunner . runSchematicAsync ( 'enum' , defaultOptions , appTree ) . toPromise ( ) ;
67- expect ( appTree . files ) . toContain ( '/projects/bar/custom/app/foo.enum.ts' ) ;
67+ expect ( appTree . files ) . toContain ( '/projects/bar/custom/app/foo.ts' ) ;
68+ } ) ;
69+
70+ it ( 'should put type in the file name' , async ( ) => {
71+ const options = { ...defaultOptions , type : 'enum' } ;
72+
73+ const tree = await schematicRunner . runSchematicAsync ( 'enum' , options , appTree ) . toPromise ( ) ;
74+ expect ( tree . files ) . toContain ( '/projects/bar/src/app/foo.enum.ts' ) ;
6875 } ) ;
6976} ) ;
0 commit comments