(address, cell, expected)
| 26 | // }; |
| 27 | |
| 28 | const assertDate = function(address, cell, expected) { |
| 29 | assert( |
| 30 | cell.type === Excel.ValueType.Date, |
| 31 | `expected ${address} type to be Date, was ${cell.type}` |
| 32 | ); |
| 33 | assert( |
| 34 | cell.value instanceof Date, |
| 35 | `expected value ${address} to be a Date, was ${cell.value}` |
| 36 | ); |
| 37 | const {value} = cell; |
| 38 | assert( |
| 39 | value.getYear() === expected.getYear(), |
| 40 | `expected ${address} Year to be ${expected.getYear()}, was ${value.getYear()}` |
| 41 | ); |
| 42 | assert( |
| 43 | value.getMonth() === expected.getMonth(), |
| 44 | `expected ${address} Month to be ${expected.getMonth()}, was ${value.getMonth()}` |
| 45 | ); |
| 46 | assert( |
| 47 | value.getDay() === expected.getDay(), |
| 48 | `expected ${address} Day to be ${expected.getDay()}, was ${value.getDay()}` |
| 49 | ); |
| 50 | assert( |
| 51 | value.getHours() === expected.getHours(), |
| 52 | `expected ${address} Hour to be ${expected.getHours()}, was ${value.getHours()}` |
| 53 | ); |
| 54 | assert( |
| 55 | value.getMinutes() === expected.getMinutes(), |
| 56 | `expected ${address} Minute to be ${expected.getMinutes()}, was ${value.getMinutes()}` |
| 57 | ); |
| 58 | assert( |
| 59 | value.getSeconds() === expected.getSeconds(), |
| 60 | `expected ${address} Second to be ${expected.getSeconds()}, was ${value.getSeconds()}` |
| 61 | ); |
| 62 | }; |
| 63 | |
| 64 | const options = { |
| 65 | dateFormats: ['DD/MM/YYYY HH:mm:ss'], |
no test coverage detected
searching dependent graphs…