Advertisement
Guest User

tests

a guest
Nov 18th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. import {calcDoubleShifts} from "./av_table.js"
  2. import {calcEastern} from "./av_table.js"
  3.  
  4. let year = 2019;
  5. const doubleShiftDays =[{day:1,month:1},{day:1,month:5},{day:1,month:11},{day:25,month:12},{day:26,month:12}] ;
  6. const easternDays =[{day:19,month:4},{day:22,month:4}];
  7. const weekendDays = [{day:23,month:11},{day:24,month:11}];
  8. const weekDays =[{day:22,month:11},{day:26,month:11}];
  9. export function startTest(){
  10. fixedHolidaysTest();
  11. weekendDaysTest();
  12. easternDaysTest();
  13. weekDaysTest();
  14. }
  15. export function fixedHolidaysTest(){
  16. console.log("---Tests for fixed holidays---");
  17. doubleShiftDays.forEach(function(singleDay){
  18. if( calcDoubleShifts(singleDay.day,singleDay.month-1,year)){
  19.  
  20. console.log("Test successful "+ year+"-"+singleDay.month+"-"+singleDay.day);
  21. }
  22. else{
  23. console.log("Test failed "+ year+"-"+singleDay.month+"-"+singleDay.day);
  24. }
  25. });
  26. }
  27.  
  28. export function weekendDaysTest(){
  29. console.log("---Tests for weekends---");
  30. weekendDays.forEach(function(singleDay){
  31. if( calcDoubleShifts(singleDay.day,singleDay.month-1,year)){
  32. console.log("Test successful for "+ year+"-"+singleDay.month+"-"+singleDay.day);
  33. }
  34. else{
  35. console.log("Test failed for "+ year+"-"+singleDay.month+"-"+singleDay.day);
  36. }
  37. });
  38. }
  39.  
  40. export function easternDaysTest(){
  41. console.log("---Tests for eastern----");
  42. easternDays.forEach(function(singleDay){
  43. if( calcDoubleShifts(singleDay.day,singleDay.month-1,year)){
  44. console.log("Test successful "+ year+"-"+singleDay.month+"-"+singleDay.day);
  45. }
  46. else{
  47. console.log("Test failed "+ year+"-"+singleDay.month+"-"+singleDay.day);
  48. }
  49. });
  50. }
  51. export function weekDaysTest(){
  52. console.log("---Tests for weekdays---");
  53. weekDays.forEach(function(singleDay){
  54. if( !calcDoubleShifts(singleDay.day,singleDay.month-1,year)){
  55. console.log("Test successful "+ year+"-"+singleDay.month+"-"+singleDay.day);
  56. }
  57. else{
  58. console.log("Test failed "+ year+"-"+singleDay.month+"-"+singleDay.day);
  59. }
  60. });
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement