Skip to content

Commit

Permalink
chore: fix type error in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswr committed Nov 13, 2023
1 parent f97ed72 commit 74c0df4
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/common/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ describe("getVerifiableCredential", () => {

await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
}),
).rejects.toThrow(/unsupported Content-Type/);
});
Expand All @@ -378,7 +378,7 @@ describe("getVerifiableCredential", () => {

await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
}),
).rejects.toThrow(
"The value received from [https://some.vc] is not a Verifiable Credential",
Expand All @@ -401,7 +401,7 @@ describe("getVerifiableCredential", () => {

await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
}),
).rejects.toThrow(
"The value received from [https://some.vc] is not a Verifiable Credential",
Expand Down Expand Up @@ -432,7 +432,7 @@ describe("getVerifiableCredential", () => {

await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
}),
).rejects.toThrow(
"The value received from [https://some.vc] is not a Verifiable Credential",
Expand All @@ -456,7 +456,7 @@ describe("getVerifiableCredential", () => {

await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
}),
).rejects.toThrow(
"The value received from [https://some.vc] is not a Verifiable Credential",
Expand All @@ -474,7 +474,7 @@ describe("getVerifiableCredential", () => {

await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
}),
).rejects.toThrow(
"The value received from [https://some.vc] is not a Verifiable Credential",
Expand All @@ -495,7 +495,7 @@ describe("getVerifiableCredential", () => {

await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
}),
).rejects.toThrow(
"The value received from [https://some.vc] is not a Verifiable Credential",
Expand All @@ -519,7 +519,7 @@ describe("getVerifiableCredential", () => {

await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
}),
).rejects.toThrow(
"The value received from [https://some.vc] is not a Verifiable Credential",
Expand All @@ -544,7 +544,7 @@ describe("getVerifiableCredential", () => {

await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
}),
).rejects.toThrow(
"The value received from [https://some.vc] is not a Verifiable Credential",
Expand All @@ -566,7 +566,7 @@ describe("getVerifiableCredential", () => {

await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
}),
).rejects.toThrow(
"The value received from [https://some.vc] is not a Verifiable Credential",
Expand Down Expand Up @@ -634,7 +634,7 @@ describe("getVerifiableCredential", () => {
);

const vc = await getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
});

// Since we have dataset properties in vc it should match the result
Expand All @@ -660,7 +660,7 @@ describe("getVerifiableCredential", () => {

await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
}),
).rejects.toThrow(
"The value received from [https://some.vc] is not a Verifiable Credential",
Expand All @@ -677,7 +677,7 @@ describe("getVerifiableCredential", () => {
);

const vc = await getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
});

const res = await jsonLdStringToStore(
Expand Down Expand Up @@ -740,7 +740,7 @@ describe("getVerifiableCredential", () => {
it("errors if the context contains an IRI that is not cached", async () => {
await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
}),
).rejects.toThrow(
"Unexpected context requested [http://example.org/my/sample/context]",
Expand All @@ -761,7 +761,7 @@ describe("getVerifiableCredential", () => {

await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
allowContextFetching: true,
}),
).resolves.toMatchObject(mockCredential);
Expand All @@ -770,7 +770,7 @@ describe("getVerifiableCredential", () => {
it("resolves if the context is cached", async () => {
await expect(
getVerifiableCredential("https://some.vc", {
fetch: mockedFetch,
fetch: mockedFetch as (typeof UniversalFetch)["fetch"],
allowContextFetching: true,
contexts: {
"http://example.org/my/sample/context": {
Expand Down

0 comments on commit 74c0df4

Please sign in to comment.