From 08dd30696e99a34a203c11c45f305b0d4dc46d40 Mon Sep 17 00:00:00 2001 From: jhoneill Date: Sun, 15 Dec 2019 23:34:55 +0000 Subject: [PATCH] fix convertFrom-ExcelSheet test - date format issue --- __tests__/ConvertFrom-ExcelSheet.Tests.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/__tests__/ConvertFrom-ExcelSheet.Tests.ps1 b/__tests__/ConvertFrom-ExcelSheet.Tests.ps1 index f3021bc..5065a33 100644 --- a/__tests__/ConvertFrom-ExcelSheet.Tests.ps1 +++ b/__tests__/ConvertFrom-ExcelSheet.Tests.ps1 @@ -21,7 +21,10 @@ Describe 'ConvertFrom-ExcelSheet / Export-ExcelSheet' { } it "Applied ASText and Properties correctly " { $firstText[1] | should match '^"\w+","\d{5}","\d{1,2}","\w+ \w+","[1-9]\d?","\w+","\d{1,2}"$' - $secondText[1] | should match '^"\w+","\d\d \w{3,} \d{4}","\d","\w+ \w+","0\d","\w+","\d{1,2}"$' + $date = $firstText[1] -replace '^.*(\d{5}).*$', '$1' + $date = [datetime]::FromOADate($date).toString("D") + $secondText[1] | should belike "*$date*" + $secondText[1] | should match '"0\d","\w+","\d{1,2}"$' $ThirdText[1] | should match '^"\w+ \w+","#\d\d/\d\d/\d{4}#","\d","0\d"$' } }