Advertisement
ErolKZ

Untitled

Feb 12th, 2022
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1.  
  2. describe('Mathematical operations', () => {
  3.  
  4. describe('addFive', () => {
  5.  
  6. it('Should return undefined - addfive', () => {
  7.  
  8. let returnValue = mathEnforcer.addFive('dassd');
  9.  
  10. expect(returnValue).to.be.undefined;
  11.  
  12. });
  13.  
  14.  
  15. it('Should add 5 - addfive', () => {
  16.  
  17. let returnValue = mathEnforcer.addFive(15);
  18.  
  19. expect(returnValue).to.be.closeTo(20, 0.01);
  20.  
  21. });
  22.  
  23.  
  24. it('Should add 5 - addfive2', () => {
  25.  
  26. let returnValue = mathEnforcer.addFive(-15);
  27.  
  28. expect(returnValue).to.be.closeTo(-10, 0.01);
  29.  
  30. });
  31.  
  32.  
  33. it('Should add 5 - addfive3', () => {
  34.  
  35. let returnValue = mathEnforcer.addFive(15.009);
  36.  
  37. expect(returnValue).to.be.closeTo(20, 0.01);
  38.  
  39. });
  40.  
  41.  
  42. });
  43.  
  44.  
  45. describe('subtractTen', () => {
  46.  
  47.  
  48. it('Should return undefined - subtractTen', () => {
  49.  
  50. let returnValue = mathEnforcer.subtractTen('dassd');
  51.  
  52. expect(returnValue).to.be.undefined;
  53.  
  54. });
  55.  
  56.  
  57. it('Should subtract ten - subtractTen', () => {
  58.  
  59. let returnValue = mathEnforcer.subtractTen(15);
  60.  
  61. expect(returnValue).to.be.closeTo(5, 0.01);
  62.  
  63. });
  64.  
  65.  
  66. it('Should subtract ten - subtractTen2', () => {
  67.  
  68. let returnValue = mathEnforcer.subtractTen(-15);
  69.  
  70. expect(returnValue).to.be.closeTo(-25, 0.01);
  71.  
  72. });
  73.  
  74. });
  75.  
  76.  
  77.  
  78. describe('sum', () => {
  79.  
  80. it('Should return undefined - sum', () => {
  81.  
  82. let returnValue = mathEnforcer.sum('das', 22);
  83.  
  84. expect(returnValue).to.be.undefined;
  85.  
  86. });
  87.  
  88.  
  89. it('Should return undefined2 - sum', () => {
  90.  
  91. let returnValue = mathEnforcer.sum(22, 'das');
  92.  
  93. expect(returnValue).to.be.undefined;
  94.  
  95. });
  96.  
  97.  
  98. it('Should return a sum - sum', () => {
  99.  
  100. let returnValue = mathEnforcer.sum(22, 12);
  101.  
  102. expect(returnValue).to.be.closeTo(34, 0.01);
  103.  
  104. });
  105.  
  106.  
  107. it('Should return a sum2 - sum2', () => {
  108.  
  109. let returnValue = mathEnforcer.sum(-15, 12);
  110.  
  111. expect(returnValue).to.be.closeTo(-3, 0.01);
  112.  
  113. });
  114.  
  115.  
  116. it('Should return a sum3 - sum3', () => {
  117.  
  118. let returnValue = mathEnforcer.sum(15, -12);
  119.  
  120. expect(returnValue).to.be.closeTo(3, 0.01);
  121.  
  122. });
  123.  
  124.  
  125. it('Should return undefined3 - sum', () => {
  126.  
  127. let returnValue = mathEnforcer.sum('sasd', 'das');
  128.  
  129. expect(returnValue).to.be.undefined;
  130.  
  131. });
  132.  
  133. });
  134.  
  135.  
  136. });
  137.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement