Skip to content

Commit 11f61f1

Browse files
committed
add typecheck
1 parent 345d086 commit 11f61f1

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

tests/contracts/provider/__tests__/utils/utils.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import path from "node:path";
22
import fs from "node:fs";
3-
import { globSync } from "glob";
43

54
const LETTER_STATUSES = [
65
"ACCEPTED",
@@ -22,15 +21,15 @@ export function getExampleEvent(status: LetterStatus): unknown {
2221
const examplePath = path.join(
2322
__dirname,
2423
"../../../../../internal/events/schemas/examples",
25-
`letter.${status}.json`
24+
`letter.${status}.json`,
2625
);
2726

28-
const content = fs.readFileSync(examplePath, "utf-8");
27+
const content = fs.readFileSync(examplePath, "utf8");
2928
return JSON.parse(content);
3029
}
3130

3231
export function getMessageProviderForStatus(
33-
status: LetterStatus
32+
status: LetterStatus,
3433
): Record<string, () => Promise<unknown>> {
3534
return {
3635
[`letter-${status.toLowerCase()}`]: async () => getExampleEvent(status),
@@ -39,13 +38,13 @@ export function getMessageProviderForStatus(
3938

4039
export function getPactUrlForStatus(
4140
consumerPackage: string,
42-
status: LetterStatus
41+
status: LetterStatus,
4342
): string {
4443
const contractsDir = path.join(
4544
__dirname,
4645
"../../.contracts",
4746
consumerPackage,
48-
"pacts/supplier-api"
47+
"pacts/supplier-api",
4948
);
5049

5150
return path.join(contractsDir, `core-letter-${status.toLowerCase()}.json`);

tests/contracts/provider/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"version": "1.0.0",
44
"private": true,
55
"scripts": {
6-
"test:contracts": "./scripts/test.sh"
6+
"test:contracts": "./scripts/test.sh",
7+
"typecheck": "tsc --noEmit"
78
},
89
"dependencies": {
910
"@nhsdigital/nhs-notify-event-schemas-supplier-api": "*",

0 commit comments

Comments
 (0)