This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('Testando a função transformRicksCollectionToFrontEnd', () => { | |
| it('Deve retornar apenas os Ricks com familias', () => { | |
| const dadosParaEsseTeste = [ | |
| dadosParaTeste.rickValido, | |
| dadosParaTeste.rickInvalido, | |
| ] | |
| const resultado = rickManipulationFunctions | |
| .retriveOnlyTheRicksWithFamily(dadosParaEsseTeste); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe('Testando a função toPickOnlyTheRicksNameAndDimension', () => { | |
| it('Deve retornar apenas um objeto com as chaves name e dimension', () => { | |
| const resultado = rickManipulationFunctions | |
| .toPickOnlyTheRicksNameAndDimension(dadosParaTeste.rickValido); | |
| expect(resultado).to.have.ownProperty('name'); | |
| expect(resultado).to.have.ownProperty('dimension') | |
| expect(resultado).to.not.have.ownProperty('family') | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function toCountIfRickHaveAFamily(rick) { | |
| if ("family" in rick) { | |
| if (rick.family.length > 0) return true; | |
| return false; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const rickManipulationFuctions = require('./rickManipulation'); | |
| const {expect} = require('chai'); | |
| const resultados = { | |
| // Aqui só colocamos um Rick que sabemos que é o que a gente quer | |
| validRick: { | |
| name: "Rick Sanchez", | |
| dimension: "C-137", | |
| family: [ | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| toPickOnlyTheRicksNameAndDimension, | |
| toCountIfRickHaveAFamily, | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function toPickOnlyTheRicksNameAndDimension(rick) { | |
| if("name" in rick && "dimension" in rick) { | |
| return { | |
| name: rick.name, | |
| dimension: rick.dimension, | |
| }; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function toCountIfRickHaveAFamily(rick) { | |
| if ("family" in rick) { | |
| if (rick.family.length >= 0) return true; | |
| return false; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ricks = [ | |
| { | |
| "name": "Rick Sanchez", | |
| "dimension": "C-137", | |
| "family": [ | |
| { | |
| name: "Morty Smith", | |
| age: 14, | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 1. Add the Spotify repository signing keys to be able to verify downloaded packages | |
| sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 931FF8E79F0876134EDDBDCCA87FF9DF48BF1C90 | |
| # 2. Add the Spotify repository | |
| echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list | |
| # 3. Update list of available packages | |
| sudo apt-get update | |
| # 4. Install Spotify |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo docker inspect -f "{{.NetworkSettings.IPAddress}}" $DOCKER_CONTAINER_ID |