Adam Cameron
expect(myQuery).toHaveKey("current_date")
Where current_date
is a column of the query.
Looking into it, it's here: https://github.com/Ortus-Solutions/TestBox/blob/v4.5.0/system/Assertion.cfc#L382
len( arguments.message ) ? arguments.message : "The key(s) [#arguments.key#] does not exist in the target object. Found keys are [#structKeyArray( arguments.target ).toString()#]"
It's barfing on structKeyArray( arguments.target )
.
The surprising thing to me is that this works on Lucee. structKeyArray
should not accept a query 😕
The docs clearly say it takes a struct: https://docs.lucee.org/reference/functions/structkeyarray.html
Why does Lucee do this shit? 😐Adam Cameron
Adam Cameron
bdw429s
04/14/2023, 10:22 PMAdam Cameron
toHaveKey
seemed to be a generic "checks for a keyish type thing"bdw429s
04/14/2023, 10:22 PMAdam Cameron
columnList
for my purposes.bdw429s
04/14/2023, 10:23 PMAdam Cameron
bdw429s
04/14/2023, 10:26 PMbdw429s
04/14/2023, 10:27 PMAdam Cameron
Adam Cameron
Adam Cameron