Last active
August 13, 2018 03:13
-
-
Save codingedgar/87a5d1b26cf2becc5d826d224c5b13f0 to your computer and use it in GitHub Desktop.
Un buen flujo de trabajo en Node.js: tests con Jest
This file contains 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
{ | |
"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" | |
} | |
} |
This file contains 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
module.exports.sum = function (a, b) { | |
return a + b; | |
} |
This file contains 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 { 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