Created
August 30, 2018 01:42
-
-
Save Horaddrim/f8a479532f8339833f182f7d857c05c4 to your computer and use it in GitHub Desktop.
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: [ | |
| { | |
| name: "Morty Smith", | |
| age: 14 | |
| }, | |
| { | |
| name: "Beth Sanchez", | |
| age: 30 | |
| }, | |
| { | |
| name: "Jerry Smith", | |
| age: 30 | |
| }, | |
| { | |
| name: "Summer Smith", | |
| age: 17 | |
| } | |
| ] | |
| }, | |
| // e outro que não é o que a gente quer! | |
| invalidRick: { | |
| name: "Rick Sanchez", | |
| dimension: "J19ζ7", | |
| family: [] | |
| }, | |
| } | |
| describe('Testando funções de manipulação de Ricks', () => { | |
| describe('Testando a função toCountIfRickHaveAFamily', () => { | |
| it('Deve retornar true se o array de family não for vazio', () => { | |
| const resultado = rickManipulationFuctions | |
| .toCountIfRickHaveAFamily(resultados.validRick); | |
| expect(resultado).to.be.equal(true); | |
| }); | |
| it('Deve retornar false se o array de family for vazio', () => { | |
| const resultado = rickManipulationFuctions | |
| .toCountIfRickHaveAFamily(resultados.invalidRick); | |
| expect(resultado).to.be.equal(false); | |
| }); | |
| }) | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment