From ae4dc25dc89c9f11400c138955b9eea71c64522c Mon Sep 17 00:00:00 2001 From: Akash Askoolum Date: Thu, 15 Apr 2021 00:01:20 +0100 Subject: [PATCH] feat: Include __mocks__ in TS output (and published library) In #223 (and #233) we started adding a tag (`gu:cdk:version`) to track which version of `@guardian/cdk` is being used. This tag helps us measure adoption: - the presence of the tag tells us the library is being used - the value of the tag tells us the version of the library being used Whilst this is really useful, it does somewhat block users from using tools such as dependabot. This is because the snapshot tests will _always_ fail due to the value of the tag changing between version numbers. In this repository, we have configured a global mock for this tag to ensure its value is static, thus simplifying the tests. This change updates the TypeScript configuration to include (more specifically stop excluding) the `__mocks__` directories. This results in all mocks making their way into the published library which can then be used within client stacks, to also have a static value. We currently have a single mock in the repository. If we add more, we may want to be more selective about which of them get published. --- tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 0c1e9e56a6..ded4e1e32e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,5 +18,5 @@ "outDir": "lib" }, "include": ["src/**/*"], - "exclude": ["node_modules", "src/**/*.test.ts", "src/**/__snapshots__/**", "src/**/__mocks__/**"] + "exclude": ["node_modules", "src/**/*.test.ts", "src/**/__snapshots__/**"] }