- To create
tsconfig.json
file:npx tsc --init
. - To compile typescript files:
npx tsc
. - To generate jest config file:
npx jest --init
. - On second curse, inside the
Domain
folder, we'll usefeatures
instead ofusecases
as folder name. - The project should use the Triple A (arrange, act and assert) pattern in tests, but what it means? Basically, we need to separate the tests in three scopes.
- To apply the Template Method Pattern is necessary to create an Abstract class which cannot be instantiated, it's useful only for inheritance, move common behavior to there, so you just need to extend that class.
- To make tests with Facebook API, you need to setup your account on
https://developers.facebook.com/
, you need to:- Add new Application;
- While you're on
Add a product
(or something like that).- Select
Login with Facebook
;
- Select
- While you're on
- On Config page you need to get
App ID
andSecret key
. - On
Roles
, you need to add/edit an account, it's necessary to update user test grants and:- remove
user_friend
; - add
email
; - add
public_profile
;
- remove
- Is Sometimes necessary to validate if the roles was applied, if no, you need to
Request
.Facebook API Name: Matheus test Pass: abc@12345
- Add new Application;
Using TypeORM is recommended to generate migrations manually.
https://shoonia.github.io/1x1/#5542c9ff
- Blank Lines
- Comments
- Data Clumps
- Divergent Change (solve by Single responsability)
- Duplicated Code (solve by DRY)
- Inappropriate Intimacy
- Feature Envy
- Large Class
- Long Method
- Long Parameter List
- Middle Man
- Primitive Obsession
- Refused Bequest
- Shotgun Surgery
- Speculative Generality (YAGNI)
You can verify if Node has support on NodeGreen.