From c05f6d69993f8500f271cf6e28157cec8195a207 Mon Sep 17 00:00:00 2001 From: Nathalia Sardou Date: Sat, 29 Oct 2022 23:25:47 -0300 Subject: [PATCH] greeting atualizado --- 01-greeting/index.js | 2 +- 01-greeting/intex.test.js | 26 +++++++++++++------------- 06-sum/index.test.js | 26 +++++++++++++------------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/01-greeting/index.js b/01-greeting/index.js index 8f551af..5c0279c 100644 --- a/01-greeting/index.js +++ b/01-greeting/index.js @@ -1,4 +1,4 @@ export function greet(name) { // implementar logica aqui - return ""; + return `Hello ${name}`; } diff --git a/01-greeting/intex.test.js b/01-greeting/intex.test.js index 2cdb497..96d9933 100644 --- a/01-greeting/intex.test.js +++ b/01-greeting/intex.test.js @@ -1,14 +1,14 @@ -import { greet } from "./." -describe("greet1", () => { - it("Dever retornar \"Hello Maria\" quando passamos a palavra \"Maria\"", () => { - expect(greet("Maria")).toBe("Hello Maria") - }) +import { greet } from './index'; +describe('greet1', () => { + it('Dever retornar "Hello Maria" quando passamos a palavra "Maria"', () => { + expect(greet('Maria')).toBe('Hello Maria'); + }); - it("Dever retornar \"Hello Alvin\" quando passamos a palavra \"Alvin\"", () => { - expect(greet("Alvin")).toBe("Hello Alvin") - }) - - it("Dever retornar \"Hello Pedro Lucas\" quando passamos a palavra \"Pedro Lucas\"", () => { - expect(greet("Pedro Lucas")).toBe("Hello Pedro Lucas") - }) -}) \ No newline at end of file + it('Dever retornar "Hello Alvin" quando passamos a palavra "Alvin"', () => { + expect(greet('Alvin')).toBe('Hello Alvin'); + }); + + it('Dever retornar "Hello Pedro Lucas" quando passamos a palavra "Pedro Lucas"', () => { + expect(greet('Pedro Lucas')).toBe('Hello Pedro Lucas'); + }); +}); diff --git a/06-sum/index.test.js b/06-sum/index.test.js index 3b85b17..8209de4 100644 --- a/06-sum/index.test.js +++ b/06-sum/index.test.js @@ -1,49 +1,49 @@ -import { sum } from "."; +import { sum } from '.'; -describe("sum", () => { - it("Dever retornar 0 quando passamos o array vazio", () => { +describe('sum', () => { + it('Dever retornar 0 quando passamos o array vazio', () => { expect(sum([])).toBe(0); }); - it("Dever retornar 1 quando passamos o array [1]", () => { + it('Dever retornar 1 quando passamos o array [1]', () => { expect(sum([1])).toBe(1); }); - it("Dever retornar 3 quando passamos o array [1, 2]", () => { + it('Dever retornar 3 quando passamos o array [1, 2]', () => { expect(sum([1, 2])).toBe(3); }); - it("Dever retornar 6 quando passamos o array [1, 2, 3]", () => { + it('Dever retornar 6 quando passamos o array [1, 2, 3]', () => { expect(sum([1, 2, 3])).toBe(6); }); - it("Dever retornar 10 quando passamos o array [1, 2, 3, 4]", () => { + it('Dever retornar 10 quando passamos o array [1, 2, 3, 4]', () => { expect(sum([1, 2, 3, 4])).toBe(10); }); - it("Dever retornar 15 quando passamos o array [1, 2, 3, 4, 5]", () => { + it('Dever retornar 15 quando passamos o array [1, 2, 3, 4, 5]', () => { expect(sum([1, 2, 3, 4, 5])).toBe(15); }); - it("Dever retornar 27 quando passamos o array [4, 6, 12, 5]", () => { + it('Dever retornar 27 quando passamos o array [4, 6, 12, 5]', () => { expect(sum([4, 6, 12, 5])).toBe(27); }); - it("Dever retornar 3886 quando passamos o array [9, 234, 312, 999, 21 , 2311]", () => { + it('Dever retornar 3886 quando passamos o array [9, 234, 312, 999, 21 , 2311]', () => { expect(sum([9, 234, 312, 999, 21, 2311])).toBe(3886); }); - it("Dever retornar 73098 quando passamos o array [533, 234, 23423, 32, 48876]", () => { + it('Dever retornar 73098 quando passamos o array [533, 234, 23423, 32, 48876]', () => { expect(sum([533, 234, 23423, 32, 48876])).toBe(73098); }); // Criar um teste para numeros negativos - it("Dever retornar -51 quando passamos o array [-1, 5, -10, -45]", () => { + it('Dever retornar -51 quando passamos o array [-1, 5, -10, -45]', () => { expect(sum([-1, 5, -10, -45])).toBe(-51); }); - it("Dever retornar -40 quando passamos o array [-2, -7, -31]", () => { + it('Dever retornar -40 quando passamos o array [-2, -7, -31]', () => { expect(sum([-2, -7, -31])).toBe(-40); }); });