Prettier 2.0 (#393)

This commit is contained in:
Steve Faulkner
2021-01-20 09:15:01 -06:00
committed by GitHub
parent c1937ca464
commit 4be53284b5
500 changed files with 41927 additions and 41838 deletions

View File

@@ -12,7 +12,7 @@ interface Global {
describe("ARM request", () => {
window.authType = AuthType.AAD;
updateUserContext({
authorizationToken: "some-token"
authorizationToken: "some-token",
});
it("should call window.fetch", async () => {
@@ -20,7 +20,7 @@ describe("ARM request", () => {
ok: true,
json: async () => {
return {};
}
},
});
await armRequest({ apiVersion: "2001-01-01", host: "https://foo.com", path: "foo", method: "GET" });
expect(window.fetch).toHaveBeenCalled();
@@ -33,7 +33,7 @@ describe("ARM request", () => {
ok: true,
headers,
status: 200,
json: async () => ({})
json: async () => ({}),
});
await armRequest({ apiVersion: "2001-01-01", host: "https://foo.com", path: "foo", method: "GET" });
expect(window.fetch).toHaveBeenCalledTimes(2);
@@ -48,7 +48,7 @@ describe("ARM request", () => {
status: 200,
json: async () => {
return { status: "Failed" };
}
},
});
await expect(() =>
armRequest({ apiVersion: "2001-01-01", host: "https://foo.com", path: "foo", method: "GET" })
@@ -59,7 +59,7 @@ describe("ARM request", () => {
it("should throw token error", async () => {
window.authType = AuthType.AAD;
updateUserContext({
authorizationToken: undefined
authorizationToken: undefined,
});
const headers = new Headers();
headers.set("location", "https://foo.com/operationStatus");
@@ -69,7 +69,7 @@ describe("ARM request", () => {
status: 200,
json: async () => {
return { status: "Failed" };
}
},
});
await expect(() =>
armRequest({ apiVersion: "2001-01-01", host: "https://foo.com", path: "foo", method: "GET" })

View File

@@ -54,7 +54,7 @@ export async function armRequest<T>({
apiVersion,
method,
body: requestBody,
queryParams
queryParams,
}: Options): Promise<T> {
const url = new URL(path, host);
url.searchParams.append("api-version", configContext.armAPIVersion || apiVersion);
@@ -70,9 +70,9 @@ export async function armRequest<T>({
const response = await window.fetch(url.href, {
method,
headers: {
Authorization: userContext.authorizationToken
Authorization: userContext.authorizationToken,
},
body: requestBody ? JSON.stringify(requestBody) : undefined
body: requestBody ? JSON.stringify(requestBody) : undefined,
});
if (!response.ok) {
let error: ARMError;
@@ -108,8 +108,8 @@ async function getOperationStatus(operationStatusUrl: string) {
const response = await window.fetch(operationStatusUrl, {
headers: {
Authorization: userContext.authorizationToken
}
Authorization: userContext.authorizationToken,
},
});
if (!response.ok) {