File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
packages/schematics/angular/pipe Expand file tree Collapse file tree 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 {
9696 options . path = buildDefaultPath ( project ) ;
9797 }
9898
99+ options . module = findModuleFromOptions ( host , options ) ;
100+
99101 const parsedPath = parseName ( options . path , options . name ) ;
100102 options . name = parsedPath . name ;
101103 options . path = parsedPath . path ;
102104
103- options . module = findModuleFromOptions ( host , options ) ;
105+ // todo remove these when we remove the deprecations
106+ options . skipTests = options . skipTests || ! options . spec ;
104107
105108 const templateSource = apply ( url ( './files' ) , [
106109 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', () => {
7979 expect ( thrownError ) . toBeDefined ( ) ;
8080 } ) ;
8181
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+
8296 it ( 'should export the pipe' , ( ) => {
8397 const options = { ...defaultOptions , export : true } ;
8498
You can’t perform that action at this time.
0 commit comments