Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/sam_package_code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc
echo "@NHSDigital:registry=https://npm.pkg.github.com" >> ~/.npmrc
echo "@nhsdigital:registry=https://npm.pkg.github.com" >> ~/.npmrc

- name: make install
run: |
Expand Down
39 changes: 0 additions & 39 deletions jest.default.config.ts

This file was deleted.

6,722 changes: 1,940 additions & 4,782 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,16 @@
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/aws-lambda": "^8.10.161",
"@types/jest": "^30.0.0",
"@types/node": "^25.3.5",
"@typescript-eslint/eslint-plugin": "^8.56.1",
"@typescript-eslint/parser": "^8.54.0",
"eslint": "^10.0.2",
"eslint-plugin-import-newlines": "^2.0.0",
"globals": "^17.4.0",
"jest": "^30.2.0",
"jest-junit": "^16.0.0",
"ts-jest": "^29.4.6",
"ts-node": "^10.9.2",
"typescript": "^5.9.3"
"typescript": "^5.9.3",
"vitest": "^3.2.4",
"@vitest/coverage-v8": "^3.2.4"
},
"dependencies": {
"esbuild": "^0.27.3"
Expand Down
24 changes: 6 additions & 18 deletions packages/capabilityStatement/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "vscode-jest-tests.v2",
"name": "Vitest: Run current file",
"request": "launch",
"program": "${workspaceFolder}/../../node_modules/vitest/vitest.mjs",
"args": [
"--runInBand",
"--watchAll=false",
"--testNamePattern",
"${jest.testNamePattern}",
"--runTestsByPath",
"${jest.testFile}",
"run",
"${file}",
"--config",
"${workspaceFolder}/jest.debug.config.ts"
"${workspaceFolder}/vitest.config.ts"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"program": "${workspaceFolder}/../../node_modules/.bin/jest",
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
},
"env": {
"POWERTOOLS_DEV": true,
"NODE_OPTIONS": "--experimental-vm-modules"
"POWERTOOLS_DEV": "true"
}
}
]
Expand Down
6 changes: 1 addition & 5 deletions packages/capabilityStatement/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{
"jest.jestCommandLine": "/workspaces/prescriptionsforpatients/node_modules/.bin/jest --no-cache",
"jest.nodeEnv": {
"POWERTOOLS_DEV": true,
"NODE_OPTIONS": "--experimental-vm-modules"
}
"vitest.commandLine": "POWERTOOLS_DEV=true /workspaces/prescriptionsforpatients/node_modules/.bin/vitest run --config vitest.config.ts"
}
9 changes: 0 additions & 9 deletions packages/capabilityStatement/jest.config.ts

This file was deleted.

9 changes: 0 additions & 9 deletions packages/capabilityStatement/jest.debug.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/capabilityStatement/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "MIT",
"type": "module",
"scripts": {
"unit": "POWERTOOLS_DEV=true NODE_OPTIONS=--experimental-vm-modules jest --no-cache --coverage",
"unit": "POWERTOOLS_DEV=true vitest run --coverage --config vitest.config.ts",
"lint": "eslint --max-warnings 0 --fix --config ../../eslint.config.mjs .",
"compile": "tsc",
"test": "npm run compile && npm run unit"
Expand Down
5 changes: 5 additions & 0 deletions packages/capabilityStatement/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {createVitestConfig} from "../../vitest.default.config"

export default createVitestConfig({
workspaceRoot: "../../"
})
16 changes: 0 additions & 16 deletions packages/common/utilities/jest.config.ts

This file was deleted.

9 changes: 0 additions & 9 deletions packages/common/utilities/jest.debug.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/common/utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"license": "MIT",
"type": "module",
"scripts": {
"unit": "POWERTOOLS_DEV=true NODE_OPTIONS=--experimental-vm-modules jest --no-cache --coverage",
"unit": "POWERTOOLS_DEV=true vitest run --coverage --config vitest.config.ts",
"lint": "eslint --max-warnings 0 --fix --config ../../../eslint.config.mjs .",
"compile": "tsc",
"test": "npm run compile && npm run unit"
Expand Down
40 changes: 39 additions & 1 deletion packages/common/utilities/tests/config.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,49 @@
import {createMockedPfPConfig, setupTestEnvironment, MockedPfPConfig} from "@pfp-common/testing"
import {
vi,
expect,
describe,
it,
beforeEach,
afterEach
} from "@jest/globals"
import {PfPConfig} from "../src/config"
import type {SSMProvider} from "@aws-lambda-powertools/parameters/ssm"

type MockedPfPConfig = {
pfpConfig: PfPConfig;
mockGet: ReturnType<typeof vi.fn>;
}

function setupTestEnvironment() {
const originalEnv = {...process.env}

const restoreEnvironment = () => {
process.env = originalEnv
vi.restoreAllMocks()
}

return {
originalEnv,
restoreEnvironment
}
}

function createMockedPfPConfig(nhsNumbers: Array<string> = []): MockedPfPConfig {
const mockGet = vi.fn()
const nhsNumbersString = nhsNumbers.join(",")
mockGet.mockResolvedValue(nhsNumbersString)

const mockSSMProvider = {
get: mockGet
} as unknown as SSMProvider

const pfpConfig = new PfPConfig(mockSSMProvider)

return {
pfpConfig,
mockGet
}
}

describe("PfPConfig", () => {
const NHS_NUMBER = "1234567890"
Expand Down
9 changes: 9 additions & 0 deletions packages/common/utilities/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {createVitestConfig} from "../../../vitest.default.config"

export default createVitestConfig({
workspaceRoot: "../../../",
aliasOverrides: {
"@pfp-common/utilities": "packages/common/utilities/src/index.ts",
"@pfp-common/utilities/config": "packages/common/utilities/src/config.ts"
}
})
24 changes: 6 additions & 18 deletions packages/distanceSelling/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "vscode-jest-tests.v2",
"name": "Vitest: Run current file",
"request": "launch",
"program": "${workspaceFolder}/../../node_modules/vitest/vitest.mjs",
"args": [
"--runInBand",
"--watchAll=false",
"--testNamePattern",
"${jest.testNamePattern}",
"--runTestsByPath",
"${jest.testFile}",
"run",
"${file}",
"--config",
"${workspaceFolder}/jest.debug.config.ts"
"${workspaceFolder}/vitest.config.ts"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"program": "${workspaceFolder}/../../node_modules/.bin/jest",
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
},
"env": {
"POWERTOOLS_DEV": true,
"NODE_OPTIONS": "--experimental-vm-modules"
"POWERTOOLS_DEV": "true"
}
}
]
Expand Down
6 changes: 1 addition & 5 deletions packages/distanceSelling/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{
"jest.jestCommandLine": "/workspaces/prescriptionsforpatients/node_modules/.bin/jest --no-cache",
"jest.nodeEnv": {
"POWERTOOLS_DEV": true,
"NODE_OPTIONS": "--experimental-vm-modules"
}
"vitest.commandLine": "POWERTOOLS_DEV=true /workspaces/prescriptionsforpatients/node_modules/.bin/vitest run --config vitest.config.ts"
}
9 changes: 0 additions & 9 deletions packages/distanceSelling/jest.config.ts

This file was deleted.

9 changes: 0 additions & 9 deletions packages/distanceSelling/jest.debug.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/distanceSelling/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"author": "NHS Digital",
"license": "MIT",
"scripts": {
"unit": "POWERTOOLS_DEV=true NODE_OPTIONS=--experimental-vm-modules jest --no-cache --coverage",
"unit": "POWERTOOLS_DEV=true vitest run --coverage --config vitest.config.ts",
"lint": "eslint --max-warnings 0 --fix --config ../../eslint.config.mjs .",
"compile": "tsc",
"test": "npm run compile && npm run unit"
Expand Down
5 changes: 5 additions & 0 deletions packages/distanceSelling/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import {createVitestConfig} from "../../vitest.default.config"

export default createVitestConfig({
workspaceRoot: "../../"
})
24 changes: 6 additions & 18 deletions packages/enrichPrescriptions/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"name": "vscode-jest-tests.v2",
"name": "Vitest: Run current file",
"request": "launch",
"program": "${workspaceFolder}/../../node_modules/vitest/vitest.mjs",
"args": [
"--runInBand",
"--watchAll=false",
"--testNamePattern",
"${jest.testNamePattern}",
"--runTestsByPath",
"${jest.testFile}",
"run",
"${file}",
"--config",
"${workspaceFolder}/jest.debug.config.ts"
"${workspaceFolder}/vitest.config.ts"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"program": "${workspaceFolder}/../../node_modules/.bin/jest",
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
},
"env": {
"POWERTOOLS_DEV": true,
"NODE_OPTIONS": "--experimental-vm-modules"
"POWERTOOLS_DEV": "true"
}
}
]
Expand Down
6 changes: 1 addition & 5 deletions packages/enrichPrescriptions/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{
"jest.jestCommandLine": "/workspaces/prescriptionsforpatients/node_modules/.bin/jest --no-cache",
"jest.nodeEnv": {
"POWERTOOLS_DEV": true,
"NODE_OPTIONS": "--experimental-vm-modules"
}
"vitest.commandLine": "POWERTOOLS_DEV=true /workspaces/prescriptionsforpatients/node_modules/.bin/vitest run --config vitest.config.ts"
}
10 changes: 0 additions & 10 deletions packages/enrichPrescriptions/jest.config.ts

This file was deleted.

Loading
Loading