Este repositório é utilizado para simular a criação de um adapter para um cliente http utilizando TDD.
Dado o endpoint users do site jsonplaceholder, crie uma classe Cliente cliente que retorne os seguintes pontos:
- Um array com o nome de todos os usuários que tem um email terminado com .biz
- Username e company name de todos os usuários na forma de um objeto {user: string, company: string}
Exemplo da saída do jsonplaceholder
[
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "[email protected]",
"address": {
"street": "Kulas Light",
"suite": "Apt. 556",
"city": "Gwenborough",
"zipcode": "92998-3874",
"geo": {
"lat": "-37.3159",
"lng": "81.1496"
}
},
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org",
"company": {
"name": "Romaguera-Crona",
"catchPhrase": "Multi-layered client-server neural-net",
"bs": "harness real-time e-markets"
}
}
]
Este treinamento aborda os seguintes conteúdos:
- Test Driven Development
- Design Pattern Adapter
- Design Pattern Factory
- Design Pattern Facade
- Mutation Tests
To install this project, run the following commands:
$ git clone https://github.com/lucsimao/testlink-facade-api
- For npm users
$ npm install
$ npm start
- For yarn users:
$ yarn install
$ yarn start
To execute this project tests, you must run the following commands:
-
Unit Tests
$ npm run test:unit
or
$ yarn test:unit
-
Functional Tests
$ npm run test:functional
$ yarn test:functional
- Lint
$ npm run lint
or
$ yarn lint
-
Style Check
npm run style:check`
npm run style:fixor
yarn style:check -
All Tests ```npm test
or
yarn test`
In this project, we used the following technologies:
- Node.js
- Visual Studio Code- Text editor with following plugins installed: DotENV, ESLint, GitLens e vscode-icons.
- Jest - Javascript Test Framework.
- ESLint - ESLint to padronize the project code.
- Prettier - To format code automatically.
- Stryker - To run mutation tests in project and use mutation badges.
Cursos
- Waldemar Neto - DO ZERO A PRODUÇÃO: APRENDA A CONSTRUIR UMA API NODE.JS COM TYPESCRIPT
- Rodrigo Manguinho - NodeJs, Typescript, TDD, DDD, Clean Architecture e SOLID
- @brunohafonso95
- Glaucia Lemos - Curso Typescript Zero To Hero
- Alura - Formação Node JS
- NodeJS Integration Test Best Practices
- NodeJS Best Practices
- Javascript Testing Best Practices
Livros
- 1999. Refactoring: improving the design of existing code. Addison-Wesley Longman Publishing Co., Inc., USA.
- Beck. 2002. Test Driven Development: By Example. Addison-Wesley Longman Publishing Co., Inc., USA.
- Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. 1995. Design patterns: elements of reusable object-oriented software. Addison-Wesley Longman Publishing Co., Inc., USA.
- Robert C. Martin. 2008. Clean Code: A Handbook of Agile Software Craftsmanship (1st. ed.). Prentice Hall PTR, USA.
- A. Jefferson Offutt and Ronald H. Untch. 2001. Mutation 2000: uniting the orthogonal. Mutation testing for the new century. Kluwer Academic Publishers, USA, 34–44.