Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import {calcDoubleShifts} from "./av_table.js"
- import {calcEastern} from "./av_table.js"
- let year = 2019;
- const doubleShiftDays =[{day:1,month:1},{day:1,month:5},{day:1,month:11},{day:25,month:12},{day:26,month:12}] ;
- const easternDays =[{day:19,month:4},{day:22,month:4}];
- const weekendDays = [{day:23,month:11},{day:24,month:11}];
- const weekDays =[{day:22,month:11},{day:26,month:11}];
- export function startTest(){
- fixedHolidaysTest();
- weekendDaysTest();
- easternDaysTest();
- weekDaysTest();
- }
- export function fixedHolidaysTest(){
- console.log("---Tests for fixed holidays---");
- doubleShiftDays.forEach(function(singleDay){
- if( calcDoubleShifts(singleDay.day,singleDay.month-1,year)){
- console.log("Test successful "+ year+"-"+singleDay.month+"-"+singleDay.day);
- }
- else{
- console.log("Test failed "+ year+"-"+singleDay.month+"-"+singleDay.day);
- }
- });
- }
- export function weekendDaysTest(){
- console.log("---Tests for weekends---");
- weekendDays.forEach(function(singleDay){
- if( calcDoubleShifts(singleDay.day,singleDay.month-1,year)){
- console.log("Test successful for "+ year+"-"+singleDay.month+"-"+singleDay.day);
- }
- else{
- console.log("Test failed for "+ year+"-"+singleDay.month+"-"+singleDay.day);
- }
- });
- }
- export function easternDaysTest(){
- console.log("---Tests for eastern----");
- easternDays.forEach(function(singleDay){
- if( calcDoubleShifts(singleDay.day,singleDay.month-1,year)){
- console.log("Test successful "+ year+"-"+singleDay.month+"-"+singleDay.day);
- }
- else{
- console.log("Test failed "+ year+"-"+singleDay.month+"-"+singleDay.day);
- }
- });
- }
- export function weekDaysTest(){
- console.log("---Tests for weekdays---");
- weekDays.forEach(function(singleDay){
- if( !calcDoubleShifts(singleDay.day,singleDay.month-1,year)){
- console.log("Test successful "+ year+"-"+singleDay.month+"-"+singleDay.day);
- }
- else{
- console.log("Test failed "+ year+"-"+singleDay.month+"-"+singleDay.day);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement