Skip to content

Instantly share code, notes, and snippets.

@lai32290
Last active October 18, 2017 19:39
Show Gist options
  • Save lai32290/99f07cc4060d03c7724c69f1fbe9c53e to your computer and use it in GitHub Desktop.
Save lai32290/99f07cc4060d03c7724c69f1fbe9c53e to your computer and use it in GitHub Desktop.
Javascript Unit Test Quick Guide - functionReturnSpec.js
import { sum } from "./myMathLib.js";
describe("Testando retorno da funcao", () => {
it("deve retornar a soma dos valores 1 e 2", () => {
const result = sum(1, 2); // pegando resultado da soma de 1 e 2
expect(result).toEqual(3); // verificar se o resultado retornado é igual a 3
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment