Skip to content

Commit

Permalink
chore: fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jeswr committed Oct 18, 2023
1 parent eac7d5d commit ed6d219
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
21 changes: 16 additions & 5 deletions src/common/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1005,31 +1005,42 @@ describe("getVerifiableCredential", () => {
DataFactory.quad(
DataFactory.namedNode("https://some.webid.provider/strelka"),
DataFactory.namedNode("https://example.org/predicateTrue"),
DataFactory.literal("true", DataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean")),
DataFactory.literal(
"true",
DataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),
),
),
);

store.add(
DataFactory.quad(
DataFactory.namedNode("https://some.webid.provider/strelka"),
DataFactory.namedNode("https://example.org/predicateFalse"),
DataFactory.literal("false", DataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean")),
DataFactory.literal(
"false",
DataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),
),
),
);

store.add(
DataFactory.quad(
DataFactory.namedNode("https://some.webid.provider/strelka"),
DataFactory.namedNode("https://example.org/predicateFalse"),
DataFactory.literal("false", DataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean")),
DataFactory.literal(
"false",
DataFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),
),
),
);

store.add(
DataFactory.quad(
DataFactory.namedNode("https://some.webid.provider/strelka"),
DataFactory.namedNode("https://w3id.org/GConsent#forPurpose"),
DataFactory.namedNode("http://example.org/known/to/be/iri/from/predicate"),
DataFactory.namedNode(
"http://example.org/known/to/be/iri/from/predicate",
),
),
);

Expand Down Expand Up @@ -1067,7 +1078,7 @@ describe("getVerifiableCredential", () => {
"https://example.org/predicateBnode": {},
"https://example.org/predicateFalse": false,
"https://example.org/predicateTrue": true,
forPurpose: "http://example.org/known/to/be/iri/from/predicate"
forPurpose: "http://example.org/known/to/be/iri/from/predicate",
},
// Any types outside of those in our VC and Inrupt context are removed
type: ["VerifiableCredential"],
Expand Down
1 change: 1 addition & 0 deletions src/common/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ export async function getVerifiableCredentialFromStore(
const compact = customContext.compactIri(predicate, true);
const termContext = customContext.getContextRaw()[compact];
const term = Util.termToValue(object, customContext, {
// FIXME: This could also be @json, xsd:type - so this needs to be more strict
// If an `@type` is defined in the context, then the
// parser can determine that it is an IRI immediately
// and so we don't need to wrap it in an object with an
Expand Down
10 changes: 7 additions & 3 deletions src/parser/jsonld.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,13 @@ describe("jsonLdResponseToStore", () => {
issuer: "https://some.example",
}),
);
await expect(jsonLdResponseToStore(response, {
allowContextFetching: false
})).rejects.toThrowError('Unexpected context requested [http://example.org/my/remote/context]');
await expect(
jsonLdResponseToStore(response, {
allowContextFetching: false,
}),
).rejects.toThrow(
"Unexpected context requested [http://example.org/my/remote/context]",
);
});

it("converting fetch response with custom prefix definition to a store", async () => {
Expand Down

0 comments on commit ed6d219

Please sign in to comment.