Last active
October 10, 2022 20:59
-
-
Save hatelove/f529ecc87391be44abea4e457034e90e to your computer and use it in GitHub Desktop.
jest installation
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
yarn add --dev babel-jest @babel/core @babel/preset-env |
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 = { | |
presets: [ | |
['@babel/preset-env', {targets: {node: 'current'}}], | |
], | |
}; |
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
class Calculator { | |
sum(first, second) { | |
return first+second; | |
} | |
} | |
describe('calculator add', function () { | |
it('positive add positive', () => { | |
let calculator = new Calculator(); | |
let sum = calculator.sum(1,2); | |
expect(sum).toBe(3); | |
}); | |
}); |
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
yarn add --dev jest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment