test.js 971 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. var assert = require("assert")
  2. var test = {
  3. version: "1.0.0"
  4. }
  5. function covTest(p1,p2) {
  6. if (p1 > 3) {
  7. return 1;
  8. }
  9. else {
  10. return p1 + p2;
  11. }
  12. }
  13. function covTest2(p1,p2) {
  14. return 0;
  15. }
  16. function covTest3(p1) {
  17. for(i=0;i < p1;i++){
  18. }
  19. return i;
  20. }
  21. function covTest4(p1) {
  22. i=0;
  23. while(i < p1){
  24. i++;
  25. }
  26. return i;
  27. }
  28. describe('Array', function(){
  29. describe('CovTest', function(){
  30. it('should return when the value is not present', function(){
  31. assert.equal(4,covTest(2,2));
  32. })
  33. })
  34. describe('CovTest>3', function(){
  35. it('should return when the value is not present', function(){
  36. assert.equal(1,covTest(4,2));
  37. })
  38. })
  39. describe('covTest4', function(){
  40. it('should return when the value is not present', function(){
  41. assert.equal(5,covTest4(5));
  42. })
  43. })
  44. describe('covTest3', function(){
  45. it('should return when the value is not present', function(){
  46. assert.equal(5,covTest3(5));
  47. })
  48. })
  49. })