@@ -25,34 +25,29 @@ export default function () {
2525 "description": "Fake schematic",
2626 "schema": "./fake-schema.json"
2727 },
28- "fake-reversed": {
29- "factory": "./fake",
30- "description": "Fake schematic",
31- "schema": "./fake-reversed-schema.json"
32- },
3328 }
3429 }` ,
3530 [ join ( genRoot , 'fake-schema.json' ) ] : `
3631 {
3732 "$id": "FakeSchema",
3833 "title": "Fake Schema",
3934 "type": "object",
40- "required": ["a "],
35+ "required": ["b "],
4136 "properties": {
4237 "b": {
4338 "type": "string",
4439 "description": "b.",
4540 "$default": {
4641 "$source": "argv",
47- "index": 1
42+ "index": 0
4843 }
4944 },
5045 "a": {
5146 "type": "string",
5247 "description": "a.",
5348 "$default": {
5449 "$source": "argv",
55- "index": 0
50+ "index": 1
5651 }
5752 },
5853 "optC": {
@@ -68,31 +63,6 @@ export default function () {
6863 "description": "optB"
6964 }
7065 }
71- }` ,
72- [ join ( genRoot , 'fake-reversed-schema.json' ) ] : `
73- {
74- "$id": "FakeReversedSchema",
75- "title": "Fake Reversed Schema",
76- "type": "object",
77- "required": ["b"],
78- "properties": {
79- "b": {
80- "type": "string",
81- "description": "b.",
82- "$default": {
83- "$source": "argv",
84- "index": 0
85- }
86- },
87- "a": {
88- "type": "string",
89- "description": "a.",
90- "$default": {
91- "$source": "argv",
92- "index": 1
93- }
94- }
95- }
9666 }` ,
9767 [ join ( genRoot , 'fake.js' ) ] : `
9868 function def(options) {
@@ -106,13 +76,9 @@ export default function () {
10676 )
10777 . then ( ( ) => ng ( 'generate' , 'fake-schematics:fake' , '--help' ) )
10878 . then ( ( { stdout } ) => {
109- assert . match ( stdout , / n g g e n e r a t e f a k e - s c h e m a t i c s : f a k e < a > \[ b \] / ) ;
79+ assert . match ( stdout , / n g g e n e r a t e f a k e - s c h e m a t i c s : f a k e < b > \[ a \] / ) ;
11080 assert . match ( stdout , / o p t - a [ \s \S ] * o p t - b [ \s \S ] * o p t - c / ) ;
11181 } )
112- . then ( ( ) => ng ( 'generate' , 'fake-schematics:fake-reversed' , '--help' ) )
113- . then ( ( { stdout } ) => {
114- assert . match ( stdout , / n g g e n e r a t e f a k e - s c h e m a t i c s : f a k e - r e v e r s e d < b > \[ a \] / ) ;
115- } )
11682 // set up default collection.
11783 . then ( ( ) =>
11884 updateJsonFile ( 'angular.json' , ( json ) => {
@@ -123,7 +89,7 @@ export default function () {
12389 . then ( ( ) => ng ( 'generate' , 'fake' , '--help' ) )
12490 // verify same output
12591 . then ( ( { stdout } ) => {
126- assert . match ( stdout , / n g g e n e r a t e f a k e < a > \[ b \] / ) ;
92+ assert . match ( stdout , / n g g e n e r a t e f a k e < b > \[ a \] / ) ;
12793 assert . match ( stdout , / o p t - a [ \s \S ] * o p t - b [ \s \S ] * o p t - c / ) ;
12894 } )
12995
0 commit comments