@@ -48,14 +48,14 @@ describe('Enum Schematic', () => {
48
48
. runSchematicAsync ( 'enum' , defaultOptions , appTree )
49
49
. toPromise ( ) ;
50
50
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' ) ;
52
52
} ) ;
53
53
54
54
it ( 'should create an enumeration' , async ( ) => {
55
55
const tree = await schematicRunner
56
56
. runSchematicAsync ( 'enum' , defaultOptions , appTree )
57
57
. toPromise ( ) ;
58
- const content = tree . readContent ( '/projects/bar/src/app/foo.enum. ts' ) ;
58
+ const content = tree . readContent ( '/projects/bar/src/app/foo.ts' ) ;
59
59
expect ( content ) . toMatch ( 'export enum Foo {' ) ;
60
60
} ) ;
61
61
@@ -64,6 +64,13 @@ describe('Enum Schematic', () => {
64
64
config . projects . bar . sourceRoot = 'projects/bar/custom' ;
65
65
appTree . overwrite ( '/angular.json' , JSON . stringify ( config , null , 2 ) ) ;
66
66
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' ) ;
68
75
} ) ;
69
76
} ) ;
0 commit comments