(filePath: string, expected: UTimestampCollection, resolveLinks = true)
| 28 | * @param resolveLinks |
| 29 | */ |
| 30 | export function assertFileTimes(filePath: string, expected: UTimestampCollection, resolveLinks = true) { |
| 31 | const actual = getFileTimes(filePath, resolveLinks); |
| 32 | |
| 33 | if (typeof expected.atime !== 'undefined') { |
| 34 | assert.equal(actual.atime, expected.atime, getTimeMismatchMessage('atime', actual, expected)); |
| 35 | } |
| 36 | |
| 37 | if (typeof expected.btime !== 'undefined' && process.platform !== 'linux') { |
| 38 | assert.equal(actual.btime, expected.btime, getTimeMismatchMessage('btime', actual, expected)); |
| 39 | } |
| 40 | |
| 41 | if (typeof expected.mtime !== 'undefined') { |
| 42 | assert.equal(actual.mtime, expected.mtime, getTimeMismatchMessage('mtime', actual, expected)); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Asserts that the given file's timestamps match (or are relatively close to) the given times. |
no test coverage detected
searching dependent graphs…