diff --git a/.changelog/1277.trivial.md b/.changelog/1277.trivial.md new file mode 100644 index 000000000..596506011 --- /dev/null +++ b/.changelog/1277.trivial.md @@ -0,0 +1 @@ +Test and fix process.env types diff --git a/src/global.d.ts b/src/types/global.d.ts similarity index 98% rename from src/global.d.ts rename to src/types/global.d.ts index ac5ddfab9..cac3fc202 100644 --- a/src/global.d.ts +++ b/src/types/global.d.ts @@ -29,3 +29,5 @@ declare global { } } } + +export {} diff --git a/src/types/global.typetest.tsx b/src/types/global.typetest.tsx new file mode 100644 index 000000000..867c80381 --- /dev/null +++ b/src/types/global.typetest.tsx @@ -0,0 +1,10 @@ +export function ExpectEnvToHaveStrictType() { + process.env.REACT_APP_SHOW_BUILD_BANNERS = undefined + process.env.REACT_APP_SHOW_BUILD_BANNERS = 'true' + process.env.REACT_APP_API = 'https://' + + // @ts-expect-error Expect typescript to detect unsupported value + process.env.REACT_APP_SHOW_BUILD_BANNERS = 'unsupported_value' + // @ts-expect-error Expect typescript to detect required field + process.env.REACT_APP_API = undefined +}