File tree 2 files changed +18
-1
lines changed
packages/schematics/angular/pipe 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -96,11 +96,14 @@ export default function (options: PipeOptions): Rule {
96
96
options . path = buildDefaultPath ( project ) ;
97
97
}
98
98
99
+ options . module = findModuleFromOptions ( host , options ) ;
100
+
99
101
const parsedPath = parseName ( options . path , options . name ) ;
100
102
options . name = parsedPath . name ;
101
103
options . path = parsedPath . path ;
102
104
103
- options . module = findModuleFromOptions ( host , options ) ;
105
+ // todo remove these when we remove the deprecations
106
+ options . skipTests = options . skipTests || ! options . spec ;
104
107
105
108
const templateSource = apply ( url ( './files' ) , [
106
109
options . spec ? noop ( ) : filter ( path => ! path . endsWith ( '.spec.ts' ) ) ,
Original file line number Diff line number Diff line change @@ -79,6 +79,20 @@ describe('Pipe Schematic', () => {
79
79
expect ( thrownError ) . toBeDefined ( ) ;
80
80
} ) ;
81
81
82
+ it ( 'should handle a path in the name and module options' , ( ) => {
83
+ appTree = schematicRunner . runSchematic (
84
+ 'module' ,
85
+ { name : 'admin/module' , project : 'bar' } ,
86
+ appTree ,
87
+ ) ;
88
+
89
+ const options = { ...defaultOptions , module : 'admin/module' } ;
90
+ appTree = schematicRunner . runSchematic ( 'pipe' , options , appTree ) ;
91
+
92
+ const content = appTree . readContent ( '/projects/bar/src/app/admin/module/module.module.ts' ) ;
93
+ expect ( content ) . toMatch ( / i m p o r t { F o o P i p e } f r o m ' \. \. \/ \. \. \/ f o o .p i p e ' / ) ;
94
+ } ) ;
95
+
82
96
it ( 'should export the pipe' , ( ) => {
83
97
const options = { ...defaultOptions , export : true } ;
84
98
You can’t perform that action at this time.
0 commit comments