Skip to content

Commit

Permalink
HAAR-1742 Replaced auditService.ts with external auditService.js from…
Browse files Browse the repository at this point in the history
… hmpps-audit-client (#83)
  • Loading branch information
ma226860 committed Dec 4, 2023
1 parent 5e23635 commit 69f72fc
Show file tree
Hide file tree
Showing 7 changed files with 1,086 additions and 1,076 deletions.
2,056 changes: 1,082 additions & 974 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"dependencies": {
"@aws-sdk/client-sqs": "^3.433.0",
"@ministryofjustice/frontend": "^1.8.0",
"@ministryofjustice/hmpps-audit-client": "^1.0.18",
"agentkeepalive": "^4.5.0",
"applicationinsights": "^2.9.0",
"body-parser": "^1.20.2",
Expand Down
1 change: 1 addition & 0 deletions server/@types/audit-client/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '@ministryofjustice/hmpps-audit-client'
8 changes: 1 addition & 7 deletions server/routes/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import type { Express } from 'express'
import request from 'supertest'
import { auditService } from '@ministryofjustice/hmpps-audit-client'
import { appWithAllRoutes } from './testutils/appSetup'
import auditService from '../services/auditService'

let app: Express

const sendAuditMessageMock = jest.fn()

afterEach(() => {
jest.resetAllMocks()
})

describe('index.test.ts', () => {
jest.mock('../services/auditService', () => ({
sendAuditMessage: sendAuditMessageMock,
}))

jest.mock('uuid', () => ({
v1: jest.fn(() => 'mocked-uuid'),
}))
Expand Down
2 changes: 1 addition & 1 deletion server/routes/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { type RequestHandler, Router } from 'express'

import { v1 as uuidv1 } from 'uuid'
import { auditService } from '@ministryofjustice/hmpps-audit-client'
import asyncMiddleware from '../middleware/asyncMiddleware'
import type { Services } from '../services'
import auditService from '../services/auditService'

// eslint-disable-next-line @typescript-eslint/no-unused-vars
export default function routes(service: Services): Router {
Expand Down
37 changes: 0 additions & 37 deletions server/services/auditService.test.ts

This file was deleted.

57 changes: 0 additions & 57 deletions server/services/auditService.ts

This file was deleted.

0 comments on commit 69f72fc

Please sign in to comment.