Skip to content

Commit

Permalink
test(credential-ld): remove expired credential from test fixtures. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis authored May 15, 2023
1 parent 031f0ef commit 13294fa
Show file tree
Hide file tree
Showing 7 changed files with 800 additions and 361 deletions.
29 changes: 0 additions & 29 deletions __tests__/fixtures/cred4.json

This file was deleted.

3 changes: 1 addition & 2 deletions __tests__/localMemoryStoreAgent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* using a SQLite db for storage of credentials and an in-memory store for keys and DIDs.
*
*/
import {
import type {
IAgentOptions,
ICredentialPlugin,
IDataStore,
Expand Down Expand Up @@ -53,7 +53,6 @@ import { FakeDidProvider, FakeDidResolver } from '../packages/test-utils/src'
import { getResolver as ethrDidResolver } from 'ethr-did-resolver'
import { getResolver as webDidResolver } from 'web-did-resolver'
import { contexts as credential_contexts } from '@transmute/credentials-context'
import * as fs from 'fs'
import { jest } from '@jest/globals'

// Shared tests
Expand Down
8 changes: 4 additions & 4 deletions __tests__/shared/credentialInterop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ export default (testContext: {
afterAll(testContext.tearDown)

test.each([
// ['cred1.json'],
// ['cred2.json'],
// ['cred1.json'], // problem with context parsing (https://github.com/transmute-industries/verifiable-data/issues/238). Fixing that leads to unsupported key type "undefined"
// ['cred2.json'], // non-standard EIP712 spec implementation
['cred3.json'],
['cred4.json'],
// ['cred4.json'], // expired
])("should verify credential from the wild: '%s'", async (text) => {
let credential = (await fs.promises.readFile(`./__tests__/fixtures/${text}`, 'utf8')).toString()
credential = JSON.parse(credential)

const result = await agent.verifyCredential({ credential })
const result = await agent.verifyCredential({ credential, fetchRemoteContexts: true })
expect(result.verified).toBe(true)
})
})
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@ethersproject/providers": "^5.7.2",
"@ethersproject/transactions": "^5.7.0",
"@ethersproject/wallet": "^5.7.0",
"@jest/globals": "^29.3.1",
"@jest/globals": "^29.5.0",
"@metamask/eth-sig-util": "^5.0.0",
"@microsoft/api-documenter": "7.19.28",
"@microsoft/api-extractor": "7.33.8",
Expand All @@ -40,8 +40,8 @@
"@transmute/credentials-context": "^0.7.0-unstable.79",
"@types/express": "4.17.15",
"@types/fs-extra": "11.0.1",
"@types/jest": "29.2.6",
"@types/node": "18.11.18",
"@types/jest": "29.5.1",
"@types/node": "20.1.4",
"@types/uuid": "^9.0.0",
"blakejs": "^1.2.1",
"caip": "^1.1.0",
Expand All @@ -53,9 +53,9 @@
"ethr-did-resolver": "^8.0.0",
"express": "^4.18.2",
"ganache": "7.7.3",
"jest": "29.3.1",
"jest-environment-jsdom": "29.3.1",
"jest-environment-node": "29.3.1",
"jest": "29.5.0",
"jest-environment-jsdom": "29.5.0",
"jest-environment-node": "29.5.0",
"json-schema": "0.4.0",
"lerna": "6.4.1",
"lerna-changelog": "2.2.0",
Expand All @@ -65,7 +65,7 @@
"pretty-quick": "3.1.3",
"rimraf": "^4.4.1",
"semantic-release": "20.0.2",
"ts-jest": "29.0.5",
"ts-jest": "29.1.0",
"ts-json-schema-generator": "1.2.0",
"ts-node": "10.9.1",
"typeorm": "^0.3.11",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/agent.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { IAgent, IPluginMethodMap, IAgentOptions, TAgent, IAgentPluginSchema } from '@veramo/core-types'
import type { IAgent, IAgentOptions, IAgentPluginSchema, IPluginMethodMap, TAgent } from '@veramo/core-types'
import { CoreEvents } from '@veramo/core-types'
import { validateArguments, validateReturnType } from './validator.js'
import ValidationErrorSchema from './schemas/ValidationError.js'
import Debug from 'debug'
import { EventEmitter } from 'events'
import { CoreEvents } from '@veramo/core-types'

/**
* Filters unauthorized methods. By default, all methods are authorized
Expand Down
4 changes: 2 additions & 2 deletions packages/did-discovery/src/abstract-did-discovery-provider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IAgentContext } from '@veramo/core-types'
import { IDIDDiscoveryDiscoverDidArgs, IDIDDiscoveryProviderResult } from './types.js'
import type { IAgentContext } from '@veramo/core-types'
import type { IDIDDiscoveryDiscoverDidArgs, IDIDDiscoveryProviderResult } from './types.js'

/**
* An abstract class for the {@link @veramo/did-discovery#DIDDiscovery} providers
Expand Down
Loading

0 comments on commit 13294fa

Please sign in to comment.