@@ -42,6 +42,45 @@ describe('FileSystemEngineHost', () => {
42
42
expect ( schematic1 . description . name ) . toBe ( 'schematic1' ) ;
43
43
} ) ;
44
44
45
+ it ( 'understands multiple aliases for a single schematic' , ( ) => {
46
+ const engineHost = new FileSystemEngineHost ( root ) ;
47
+ const engine = new SchematicEngine ( engineHost ) ;
48
+
49
+ const testCollection = engine . createCollection ( 'aliases-many' ) ;
50
+
51
+ const schematic1 = engine . createSchematic ( 'alias1' , testCollection ) ;
52
+ expect ( schematic1 ) . not . toBeNull ( ) ;
53
+ expect ( schematic1 . description . name ) . toBe ( 'schematic1' ) ;
54
+
55
+ const schematic2 = engine . createSchematic ( 'alias2' , testCollection ) ;
56
+ expect ( schematic2 ) . not . toBeNull ( ) ;
57
+ expect ( schematic2 . description . name ) . toBe ( 'schematic1' ) ;
58
+
59
+ const schematic3 = engine . createSchematic ( 'alias3' , testCollection ) ;
60
+ expect ( schematic3 ) . not . toBeNull ( ) ;
61
+ expect ( schematic3 . description . name ) . toBe ( 'schematic1' ) ;
62
+ } ) ;
63
+
64
+
65
+ it ( 'allows dupe aliases for a single schematic' , ( ) => {
66
+ const engineHost = new FileSystemEngineHost ( root ) ;
67
+ const engine = new SchematicEngine ( engineHost ) ;
68
+
69
+ const testCollection = engine . createCollection ( 'aliases-dupe' ) ;
70
+
71
+ const schematic1 = engine . createSchematic ( 'alias1' , testCollection ) ;
72
+ expect ( schematic1 ) . not . toBeNull ( ) ;
73
+ expect ( schematic1 . description . name ) . toBe ( 'schematic1' ) ;
74
+
75
+ const schematic2 = engine . createSchematic ( 'alias2' , testCollection ) ;
76
+ expect ( schematic2 ) . not . toBeNull ( ) ;
77
+ expect ( schematic2 . description . name ) . toBe ( 'schematic1' ) ;
78
+
79
+ const schematic3 = engine . createSchematic ( 'alias3' , testCollection ) ;
80
+ expect ( schematic3 ) . not . toBeNull ( ) ;
81
+ expect ( schematic3 . description . name ) . toBe ( 'schematic1' ) ;
82
+ } ) ;
83
+
45
84
it ( 'lists schematics but not aliases' , ( ) => {
46
85
const engineHost = new FileSystemEngineHost ( root ) ;
47
86
const engine = new SchematicEngine ( engineHost ) ;
0 commit comments