Skip to content

Commit

Permalink
Update tests for exposing internal error description
Browse files Browse the repository at this point in the history
  • Loading branch information
paulb777 committed May 23, 2023
1 parent 2f35a9d commit f094a90
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion FirebaseFunctions/Backend/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ exports.unknownErrorTest = functions.https.onRequest((request, response) => {
response.status(400).send({
error: {
status: 'THIS_IS_NOT_VALID',
message: 'this should be ignored',
message: 'invalid response',
},
});
});
Expand Down
3 changes: 3 additions & 0 deletions FirebaseFunctions/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 10.11.0
- [fixed] Provide more detail for internal errors. (#11310)

# 10.10.0
- [fixed] Fixed potential memory leak of Functions instances. (#11248)
- [added] Callable functions can now opt in to using limited-use App Check
Expand Down
8 changes: 4 additions & 4 deletions FirebaseFunctions/Tests/Integration/IntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ class IntegrationTests: XCTestCase {
} catch {
let error = error as NSError
XCTAssertEqual(FunctionsErrorCode.internal.rawValue, error.code)
XCTAssertNotEqual("INTERNAL", error.localizedDescription)
XCTAssertEqual("INTERNAL", error.localizedDescription)
expectation.fulfill()
return
}
Expand Down Expand Up @@ -473,7 +473,7 @@ class IntegrationTests: XCTestCase {
} catch {
let error = error as NSError
XCTAssertEqual(FunctionsErrorCode.internal.rawValue, error.code)
XCTAssertNotEqual("INTERNAL", error.localizedDescription)
XCTAssertEqual("INTERNAL", error.localizedDescription)
}
}
}
Expand All @@ -498,7 +498,7 @@ class IntegrationTests: XCTestCase {
} catch {
let error = error as NSError
XCTAssertEqual(FunctionsErrorCode.internal.rawValue, error.code)
XCTAssertNotEqual("INTERNAL", error.localizedDescription)
XCTAssertEqual("invalid response", error.localizedDescription)
expectation.fulfill()
return
}
Expand Down Expand Up @@ -528,7 +528,7 @@ class IntegrationTests: XCTestCase {
} catch {
let error = error as NSError
XCTAssertEqual(FunctionsErrorCode.internal.rawValue, error.code)
XCTAssertNotEqual("INTERNAL", error.localizedDescription)
XCTAssertEqual("invalid response", error.localizedDescription)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ - (void)testUnknownError {
completion:^(FIRHTTPSCallableResult *_Nullable result, NSError *_Nullable error) {
XCTAssertNotNil(error);
XCTAssertEqual(FIRFunctionsErrorCodeInternal, error.code);
XCTAssertNotEqualObjects(@"INTERNAL", error.localizedDescription);
XCTAssertEqualObjects(@"invalid response", error.localizedDescription);
[expectation fulfill];
}];
[self waitForExpectations:@[ expectation ] timeout:10];
Expand Down

0 comments on commit f094a90

Please sign in to comment.