Dieses Repository beinhaltet HTML- und Javascript Code zur einer NotizenWebApp auf Basis von Web Storage. Zudem sind Mocha/Chai Tests im Browser enthalten. https://meinenotizen.netlify.app/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sum.test.js 784B

123456789101112131415161718192021222324252627282930313233
  1. /* public/sum.test.js */
  2. describe('#sum()', function() {
  3. context('without arguments', function() {
  4. it('should return 0', function() {
  5. expect(sum()).to.equal(0)
  6. })
  7. })
  8. context('with number arguments', function() {
  9. it('should return sum of arguments', function() {
  10. expect(sum(1, 2, 3, 4, 5)).to.equal(15)
  11. })
  12. it('should return argument when only one argument is passed', function() {
  13. expect(sum(5)).to.equal(5)
  14. })
  15. })
  16. context('with non-number arguments', function() {
  17. it('should throw error', function() {
  18. expect(function() {
  19. sum(1, 2, '3', [4], 5)
  20. }).to.throw(TypeError, 'sum() expects only numbers.')
  21. })
  22. })
  23. })