razroo / codemorph

Codemorph is an extensible, easy to understand, easy to contribute to, easy to use Codemod library. Codemorph is platform agnostic.
MIT License
21 stars 2 forks source link

Tests in effects having different naming conventions #1

Closed mystica2000 closed 1 year ago

mystica2000 commented 1 year ago

like service effects has "user-service.ts" https://github.com/razroo/codemorph/blob/e38729a87109a3a4c2da023a5339a48f66cbd6ed/src/rz/angular/effects/service/service.spec.ts#L11

But for components, It has "sample.component.ts" https://github.com/razroo/codemorph/blob/e38729a87109a3a4c2da023a5339a48f66cbd6ed/src/rz/angular/effects/component/component-effects.spec.ts#L12

CharlieGreenman commented 1 year ago

The way this will be approached is that file names for all mocks will be kept as generic. In place of actual name of file we will put in a curly brace i.e. {name} (this is actually how we name files in the Code CMS over at razroo.com/dna so it's consistent across our codebase)

E.g. per examples above

 const mockFilePath = 'src/rz/angular/effects/service/{name}.service.ts'; 

and

const mockFilePath = 'src/rz/angular/effects/component/{name}.component.ts'; 

Regarding looking up files that will need be ported over there will be no super easy way of approaching this, other than to go through snaps and change over the file names to be generic.

Feel free to take time and space out for this one. Unit tests will complain if done incorrectly so can use that as a guiding light.

CharlieGreenman commented 1 year ago

Per conversation we will just update the:

const mockFilePath = 'src/rz/angular/effects/service/user-service.ts'; 

to be

const mockFilePath = 'src/rz/angular/effects/service/user.service.ts'; 

file and then we will consider this ticket as done

CharlieGreenman commented 1 year ago

completed