diff --git a/package.json b/package.json index 4ecb6bed..204ac818 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "lib/**/*.js" ], "dependencies": { - "@digitalbazaar/credentials-v2-context": "github:digitalbazaar/credentials-v2-context#initial", + "@digitalbazaar/credentials-v2-context": "github:digitalbazaar/credentials-v2-context", "credentials-context": "^2.0.0", "ed25519-signature-2018-context": "^1.1.0", "jsonld": "^8.3.1", diff --git a/test/contexts/examples-v2.js b/test/contexts/examples-v2.js new file mode 100644 index 00000000..d51fff87 --- /dev/null +++ b/test/contexts/examples-v2.js @@ -0,0 +1,11 @@ +/*! +* Copyright (c) 2024 Digital Bazaar, Inc. All rights reserved. +*/ +const contextUrl = 'https://www.w3.org/ns/credentials/examples/v2'; +const context = { + '@context': { + '@vocab': 'https://www.w3.org/ns/credentials/examples#' + } +}; +export const constants = {CREDENTIALS_V2_EXAMPLE_CONTEXT_URL: contextUrl}; +export const contexts = new Map([[contextUrl, context]]); diff --git a/test/contexts/index.js b/test/contexts/index.js index d936d931..c2efb969 100644 --- a/test/contexts/index.js +++ b/test/contexts/index.js @@ -29,6 +29,10 @@ import { CONTEXT_V1 as vcExamplesV1Ctx, CONTEXT_URL_V1 as vcExamplesV1CtxUrl } from '@digitalbazaar/credentials-examples-context'; +import { + constants as vcExamplesV2Constants, + contexts as vcExamplesV2Contexts +} from './examples-v2.js'; import {invalidId} from './invalid_id.js'; import {nullId} from './null_id.js'; import {nullType} from './null_type.js'; @@ -37,6 +41,7 @@ import {nullVersion} from './null_version.js'; const {CONTEXT_URL: ED25519_CONTEXT_URL} = ed25519Constants; const {CREDENTIALS_CONTEXT_V1_URL} = credentialsConstants; const {CONTEXT_URL: CREDENTIALS_CONTEXT_V2_URL} = credentialsV2Constants; +const {CREDENTIALS_V2_EXAMPLE_CONTEXT_URL} = vcExamplesV2Constants; const {DID_CONTEXT_URL} = didConstants; const {VERES_ONE_CONTEXT_V1_URL} = v1Constants; @@ -68,6 +73,10 @@ export const validContexts = { examplesContext: { url: vcExamplesV1CtxUrl, value: vcExamplesV1Ctx + }, + examplesV2Context: { + url: CREDENTIALS_V2_EXAMPLE_CONTEXT_URL, + value: vcExamplesV2Contexts.get(CREDENTIALS_V2_EXAMPLE_CONTEXT_URL) } }; diff --git a/test/mocks/credential.js b/test/mocks/credential.js index 0698faae..133cbd91 100644 --- a/test/mocks/credential.js +++ b/test/mocks/credential.js @@ -21,7 +21,7 @@ export const versionedCredentials = new Map([ [2.0, () => klona({ '@context': [ 'https://www.w3.org/ns/credentials/v2', - 'https://www.w3.org/2018/credentials/examples/v1' + 'https://www.w3.org/ns/credentials/examples/v2' ], id: 'http://example.edu/credentials/1872', type: ['VerifiableCredential', 'AlumniCredential'],