Skip to content

Instantly share code, notes, and snippets.

@codingedgar
Last active August 13, 2018 03:13
Show Gist options
  • Save codingedgar/87a5d1b26cf2becc5d826d224c5b13f0 to your computer and use it in GitHub Desktop.
Save codingedgar/87a5d1b26cf2becc5d826d224c5b13f0 to your computer and use it in GitHub Desktop.
Un buen flujo de trabajo en Node.js: tests con Jest
{
"name": "jest",
"version": "1.0.0",
"main": "sum.js",
"repository": "git@gist.github.com:87a5d1b26cf2becc5d826d224c5b13f0.git",
"author": "EdgarJRG <edgarj_rodriguezg@hotmail.com>",
"license": "MIT",
"scripts": {
"test": "jest"
},
"dependencies": {
"jest": "^23.4.2"
}
}
module.exports.sum = function (a, b) {
return a + b;
}
const { sum } = require('./sum');
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment