Skip to content

Commit

Permalink
fix: do not import test logger in src (#746)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <timo@animo.id>
  • Loading branch information
TimoGlastra committed May 6, 2022
1 parent 245223a commit 5c80004
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,12 @@ jobs:
- name: Prettier
run: yarn check-format

- name: Compile
- name: Check Types
run: yarn check-types

- name: Compile
run: yarn build

integration-test:
runs-on: ubuntu-20.04
name: Integration Tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ describe('CredentialService', () => {
eventEmitter,
indyIssuerService,
indyLedgerService,
indyHolderService
indyHolderService,
agentConfig
),
revocationService
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ describe('CredentialService', () => {
eventEmitter,
indyIssuerService,
indyLedgerService,
indyHolderService
indyHolderService,
agentConfig
),
revocationService
)
Expand Down Expand Up @@ -289,7 +290,8 @@ describe('CredentialService', () => {
eventEmitter,
indyIssuerService,
indyLedgerService,
indyHolderService
indyHolderService,
agentConfig
),
revocationService
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,8 @@ describe('CredentialService', () => {
eventEmitter,
indyIssuerService,
indyLedgerService,
indyHolderService
indyHolderService,
agentConfig
),
revocationService
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ describe('CredentialService', () => {
eventEmitter,
indyIssuerService,
indyLedgerService,
indyHolderService
indyHolderService,
agentConfig
),
revocationService
)
Expand Down Expand Up @@ -307,7 +308,8 @@ describe('CredentialService', () => {
eventEmitter,
indyIssuerService,
indyLedgerService,
indyHolderService
indyHolderService,
agentConfig
),
revocationService
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Attachment } from '../../../../decorators/attachment/Attachment'
import type { Logger } from '../../../../logger'
import type {
NegotiateProposalOptions,
OfferCredentialOptions,
Expand Down Expand Up @@ -32,7 +33,7 @@ import { Lifecycle, scoped } from 'tsyringe'

import { AriesFrameworkError } from '../../../../../src/error'
import { MessageValidator } from '../../../../../src/utils/MessageValidator'
import logger from '../../../../../tests/logger'
import { AgentConfig } from '../../../../agent/AgentConfig'
import { EventEmitter } from '../../../../agent/EventEmitter'
import { uuid } from '../../../../utils/uuid'
import { IndyHolderService, IndyIssuerService } from '../../../indy'
Expand All @@ -53,19 +54,22 @@ export class IndyCredentialFormatService extends CredentialFormatService {
private indyLedgerService: IndyLedgerService
private indyHolderService: IndyHolderService
protected credentialRepository: CredentialRepository // protected as in base class
private logger: Logger

public constructor(
credentialRepository: CredentialRepository,
eventEmitter: EventEmitter,
indyIssuerService: IndyIssuerService,
indyLedgerService: IndyLedgerService,
indyHolderService: IndyHolderService
indyHolderService: IndyHolderService,
agentConfig: AgentConfig
) {
super(credentialRepository, eventEmitter)
this.credentialRepository = credentialRepository
this.indyIssuerService = indyIssuerService
this.indyLedgerService = indyLedgerService
this.indyHolderService = indyHolderService
this.logger = agentConfig.logger
}

/**
Expand Down Expand Up @@ -156,7 +160,7 @@ export class IndyCredentialFormatService extends CredentialFormatService {
if (!attachment) {
throw new AriesFrameworkError('Missing offer attachment in processOffer')
}
logger.debug(`Save metadata for credential record ${credentialRecord.id}`)
this.logger.debug(`Save metadata for credential record ${credentialRecord.id}`)

const credOffer: CredOffer = attachment.getDataAsJson<CredOffer>()

Expand Down

0 comments on commit 5c80004

Please sign in to comment.