lmajano
10/12/2022, 8:17 PMJames Balaguer
10/18/2022, 9:50 PMexpect()
without using describe
and it
? meaning just like an `assert()`:
function testExpectationExamples () {
var message = "A custom message can be prepended to the error message!";
// toBe( expected, [message] ) : Assert something is equal to each other, no case is required
var value = "myValue";
expect(value).toBe("myvalue", message);
expect(value).toBe("myValue", message);
expect(value).toBe("MYVALUE", message);
}
gpickin
10/19/2022, 9:30 PMvar oResponse = deserializeJSON( event.getRenderedContent() );
expect( oResponse ).toBeStruct()
.toHaveKeyWithCase( "error" )
.toHaveKeyWithCase( "messages" );
expect( oResponse.error ).toBeFalse();
expect( oResponse.messages )
.toBeArray()
.toHaveLengthGTE( 1 );
expect( oResponse.messages[1] ).toBe( "postPandaDocWebhookRecipientCompletedADocument Interception point announced" );
to
expect( event ).toHaveAPISuccessWithMessage( "postPandaDocWebhookRecipientCompletedADocument Interception point announced" );
Adam Cameron
Adam Cameron
Adam Cameron
zackster
10/26/2022, 10:34 AMjoechastain
10/26/2022, 11:34 AMroute
helper function, I get an error message that states Variable STRUCTVALUEARRAY is undefined
in cbPlaywright\models\PlaywrightMixins.cfm
on line 73. That line is var pathArray = structValueArray( arguments );
β structValueArray
is not a function in ACF.Jim Priest
11/04/2022, 3:07 PMzackster
12/07/2022, 5:56 PMsknowlton
12/09/2022, 12:44 PMtestbox run
or do you launch your tests some other way?joechastain
01/27/2023, 6:34 PMcgi.remote_user
populated in main.index
as I'm doing something like userId = cgi.remote_user
and then passing userID
into a function to retrieve data and then display it on the screen based on who is logged in. What is the best approach here?johnbarrett
01/31/2023, 12:29 AMjoechastain
02/10/2023, 4:55 PMexecute
call of the handler?Adam Cameron
Adam Cameron
richard.herbert
04/14/2023, 11:38 AMcfhttp
call so I can test the subsequent processing of the data returned.
I've mocked the component with createMock()
and mocked the result with $property()
but when I run my test the API is called, which of course fails, because I'm not giving it all the info it needs to run.
Is this type of thing impossible to test unless I wrap the API call in its own method, so I can mock that out completely? I'm cool with that if it's the only solution, I just wanted to have some tests in place before I did any refactoring.
Opinions welcomed.Adam Cameron
<cfhttp>
call, precisely for this; then you mock that out.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? πJ
04/24/2023, 2:10 PMif( loginAttempt > 3) {
cfthrow message="your account may be locked."
}
So, In the testbox side how can I able to achieve the expectations? Could you please help me?bockensm
04/26/2023, 6:31 PMreporter=mintext outputFile=/path/to/file.xml outputFormats=junit
but it doesn't write the file. I'm using this in GitLab CI so I want to see the mintext results when viewing the pipeline, but GitLab also wants junit XML for one if its features to show when tests started failing.lmajano
05/05/2023, 1:19 PMevagoras
05/11/2023, 2:13 PMaliaspooryorik
asyncAll
when doing given > when > then.lmajano
06/15/2023, 2:57 PMAdam Cameron
lmajano
07/27/2023, 4:26 PMbe.
Welcome to the world of TestBox Modules!! Hierarchical Modules for Testing Pleasures: https://ortussolutions.atlassian.net/browse/TESTBOX-377
Please try it out and let me know how we can improve it!lmajano
08/01/2023, 10:36 AMaliaspooryorik
richard.herbert
08/09/2023, 4:40 PM/tests
now respond with...