feat: test integration connection (#669)
* feat: add test integration for pi-hole * refactor: test integration for pi-hole * fix: multiple secrets of same type could be used for integration creation * fix: remove integration test connection test and add mock for test-connection function * fix: add missing onUpdateFn to mysql integration secrets * fix: format issues * feat: add home assistant test connection * fix: deepsource issues * test: add system integration tests for test connection * fix: add before all for pulling home assistant image * test: add unit tests for handleTestConnectionResponseAsync * test: add unit test for testConnectionAsync * test: add mroe tests to integration-test-connection * fix: deepsource issues * fix: deepsource issue * chore: address pull request feedback
This commit is contained in:
@@ -9,3 +9,16 @@ export const extractErrorMessage = (error: unknown) => {
|
||||
|
||||
return "Unknown error";
|
||||
};
|
||||
|
||||
export abstract class FlattenError extends Error {
|
||||
constructor(
|
||||
message: string,
|
||||
private flattenResult: Record<string, unknown>,
|
||||
) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public flatten(): Record<string, unknown> {
|
||||
return this.flattenResult;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
export const appendPath = (url: URL | string, path: string) => {
|
||||
const newUrl = new URL(url);
|
||||
newUrl.pathname += path;
|
||||
newUrl.pathname = removeTrailingSlash(newUrl.pathname) + path;
|
||||
return newUrl;
|
||||
};
|
||||
|
||||
const removeTrailingSlash = (path: string) => {
|
||||
return path.at(-1) === "/" ? path.substring(0, path.length - 1) : path;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user