Last active
November 3, 2022 14:02
-
-
Save martijn/882c5e1bbe270d1741996b6e76d47feb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable @typescript-eslint/no-empty-function */ | |
import { Context, Form, HttpRequest, Logger } from "@azure/functions"; | |
export const buildContext = (): Context => ({ | |
bindingData: undefined, | |
bindingDefinitions: [], | |
bindings: { }, | |
executionContext: undefined, | |
invocationId: "", | |
log: createLogger(), | |
traceContext: undefined, | |
done: () => {}, | |
}); | |
export const buildHttpRequest = (): HttpRequest => ({ | |
headers: undefined, | |
method: undefined, | |
params: undefined, | |
parseFormBody(): Form { | |
return undefined; | |
}, | |
query: {}, | |
url: "", | |
user: undefined, | |
}); | |
const createLogger = (): Logger => { | |
const logger = () => {}; | |
logger.error = () => {}; | |
logger.info = () => {}; | |
logger.verbose = () => {}; | |
logger.warn = () => {}; | |
return logger; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment