File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
FirebaseFunctions/Tests/ObjCIntegration Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -290,4 +290,28 @@ - (void)testTimeout {
290290 [self waitForExpectations: @[ expectation ] timeout: 10 ];
291291}
292292
293+ - (void )testFunctionsReturnsOnMainThread {
294+ XCTestExpectation *expectation = [[XCTestExpectation alloc ] init ];
295+ FIRHTTPSCallable *function = [_functions HTTPSCallableWithName: @" scalarTest" ];
296+ [function callWithObject: @17
297+ completion: ^(FIRHTTPSCallableResult *_Nullable result, NSError *_Nullable error) {
298+ XCTAssert (NSThread .isMainThread );
299+ XCTAssertNotNil (result);
300+ [expectation fulfill ];
301+ }];
302+ [self waitForExpectations: @[ expectation ] timeout: 10 ];
303+ }
304+
305+ - (void )testFunctionErrorsOnMainThread {
306+ XCTestExpectation *expectation = [[XCTestExpectation alloc ] init ];
307+ FIRHTTPSCallable *function = [_functions HTTPSCallableWithName: @" httpErrorTest" ];
308+ [function callWithObject: @{}
309+ completion: ^(FIRHTTPSCallableResult *_Nullable result, NSError *_Nullable error) {
310+ XCTAssert (NSThread .isMainThread );
311+ XCTAssertNotNil (error);
312+ [expectation fulfill ];
313+ }];
314+ [self waitForExpectations: @[ expectation ] timeout: 10 ];
315+ }
316+
293317@end
You can’t perform that action at this time.
0 commit comments