Skip to content

Instantly share code, notes, and snippets.

View Horaddrim's full-sized avatar
👽
Seeking knowledge...

Horaddrim Horaddrim

👽
Seeking knowledge...
  • C-137
View GitHub Profile
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);
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')
});
});
function toCountIfRickHaveAFamily(rick) {
if ("family" in rick) {
if (rick.family.length > 0) return true;
return false;
}
}
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: [
{
module.exports = {
toPickOnlyTheRicksNameAndDimension,
toCountIfRickHaveAFamily,
};
function toPickOnlyTheRicksNameAndDimension(rick) {
if("name" in rick && "dimension" in rick) {
return {
name: rick.name,
dimension: rick.dimension,
};
}
}
function toCountIfRickHaveAFamily(rick) {
if ("family" in rick) {
if (rick.family.length >= 0) return true;
return false;
}
}
const ricks = [
{
"name": "Rick Sanchez",
"dimension": "C-137",
"family": [
{
name: "Morty Smith",
age: 14,
},
{
# 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
sudo docker inspect -f "{{.NetworkSettings.IPAddress}}" $DOCKER_CONTAINER_ID