Skip to content

Instantly share code, notes, and snippets.

@IsTheJack
Created February 11, 2018 22:32
Show Gist options
  • Save IsTheJack/18a51e5f7833310f7ac9fdc22817d0a0 to your computer and use it in GitHub Desktop.
Save IsTheJack/18a51e5f7833310f7ac9fdc22817d0a0 to your computer and use it in GitHub Desktop.
// increment.js
const increment = n => n + 1;
// increment.test.js
describe('Testing increment pure function', () => {
it('Incrementing 1 must to return 2', () => {
// O valor esperado do retorno da função increment
const expectedResult = 2;
// Passando 1 como argumento, o retorno deve ser 2
expect(increment(1)).toBe(expectedResult);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment